{"id":15792686,"url":"https://github.com/nfour/js-to-ahk","last_synced_at":"2026-01-12T00:41:15.179Z","repository":{"id":44141739,"uuid":"188179130","full_name":"nfour/js-to-ahk","owner":"nfour","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-03T22:27:05.000Z","size":400,"stargazers_count":0,"open_issues_count":12,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-11T23:14:45.703Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nfour.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-23T06:59:51.000Z","updated_at":"2019-05-25T04:59:24.000Z","dependencies_parsed_at":"2023-02-01T11:16:16.225Z","dependency_job_id":null,"html_url":"https://github.com/nfour/js-to-ahk","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nfour%2Fjs-to-ahk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nfour%2Fjs-to-ahk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nfour%2Fjs-to-ahk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nfour%2Fjs-to-ahk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nfour","download_url":"https://codeload.github.com/nfour/js-to-ahk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246523896,"owners_count":20791444,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-04T23:02:50.257Z","updated_at":"2026-01-12T00:41:10.160Z","avatar_url":"https://github.com/nfour.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# (WIP) Simple AHK - A simple AHK transpiler\n\n\u003e Write Javscript and produce .ahk scripts\n\nThis project is limited in scope to:\n- Set key bindings\n- Set keys to repeat\n- Set keys to toggle\n- _A composition of the above_\n\n- [Purpose](#purpose)\n- [Example](#example)\n- [API](#api)\n- [Why](#why)\n\n## Purpose\n\n- Gaming. Write macros for games to fine tune bindings and reduce RSI\n- Also useful for general simple desktop bindings\n- Composition. Compose existing AHK scripts and arbitrary snippets to manage your scripts programmatically.\n\n## Example\n\n\u003e Gaming example\n\n```ts\nimport { Ahk, repeatWhilePressed, toggleRepeatOnTap, toggleOnTap } from 'simple-ahk\n\nAhk()\n  .IfWinActive('ahk_class my_game')\n  .bind('LShift', 'Space')\n  .bind( '$~LButton', repeatWhilePressed({ whilePressed: 'LButton', repeatKeys: ['LButton'] }))\n  .bind('$~RButton', toggleRepeatOnTap({ whenTapped: 'RButton', repeatKeys: ['RButton'] }))\n  .bind('$x', toggleOnTap({ whenTapped: 'x', toogleKeys: ['z'] }))\n  .toFile('./myScript.ahk')\n\n\nconst myScript = Ahk()\n  .SingleInstance('Force')\n  .bind('LShift', 'Space')\n  .toString()\n\n\nAhk()\n  .raw(`\n    #IfWinActive, ahk_class foobar\n\n    LShift::Space\n  `)\n  .toFile('./myRawScript.ahk')\n```\n\n## API\n\n- `Ahk` exposes a fluid interface.\n- Each method call pushes lines to the stack, so order matters.\n  \n```ts\nconst ahk = Ahk()\n\nahk.IfWinActive('ahk_class my_game')\n// #IfWinActive, ahk_class my_game\n\nahk.bind('~LShift', 'Space')\n// ~LShift::Space\n\nahk.raw(`~LButton::RButton`)\n// ~LButton::RButton\n\nahk.toFile('./myScript.ahk')\n// Writes the script to the path, which is relative to the initial file, `dirname(require.main.filename)`\n\nahk.toString() // Returns the script as as string.\n/*\n#IfWinActive, ahk_class my_game\n\n~LShift::Space\n~LButton::RButton\n*/\n\nahk.stack // The current stack, as [[]]\n```\n\n## Why\n\n- AHK is seems like the most dominant way of producing bindings in Windows effectively\n- AHK is a miserable language to work in\n- It's less complex to transpile to AHK than to use AHK libs, as the scope of this project is quite focused. The transpiled code can then be audited or checked out.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnfour%2Fjs-to-ahk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnfour%2Fjs-to-ahk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnfour%2Fjs-to-ahk/lists"}