{"id":16320675,"url":"https://github.com/ento/chromeos-key-remapper","last_synced_at":"2025-03-20T22:31:14.243Z","repository":{"id":66498138,"uuid":"122790697","full_name":"ento/chromeos-key-remapper","owner":"ento","description":"IME / tooling for remapping key combos to other key combos on Chrome OS","archived":false,"fork":false,"pushed_at":"2023-07-13T03:09:38.000Z","size":80,"stargazers_count":35,"open_issues_count":1,"forks_count":14,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-10-11T22:45:06.822Z","etag":null,"topics":["chromeos","emacs","ime","keyboard"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ento.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-24T23:57:11.000Z","updated_at":"2024-09-13T16:36:43.000Z","dependencies_parsed_at":"2024-10-28T09:07:39.214Z","dependency_job_id":"ba908020-bfc3-4986-ae47-6f1bebd3e913","html_url":"https://github.com/ento/chromeos-key-remapper","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/ento%2Fchromeos-key-remapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ento%2Fchromeos-key-remapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ento%2Fchromeos-key-remapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ento%2Fchromeos-key-remapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ento","download_url":"https://codeload.github.com/ento/chromeos-key-remapper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244085009,"owners_count":20395523,"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":["chromeos","emacs","ime","keyboard"],"created_at":"2024-10-10T22:45:04.947Z","updated_at":"2025-03-20T22:31:14.238Z","avatar_url":"https://github.com/ento.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# chromeos-key-remapper\n\nThis repo contains:\n\n1. An unpublished Chrome OS IME that lets you use emacs-like cursor movement\n   keys with a US English keyboard. `C-a` and `C-k`, to name a few.\n2. Tooling to build a custom IME that combines the remapper engine and other 3rd party IMEs.\n\n## Limitations\n\n- All the combined IMEs share the same JavaScript scope. Name collision\n  can happen.\n- The options page of the custom IME can only display the options page of a\n  single IME.\n- Keys can be only remapped to other key combinations. i.e. can't do things\n  that the OS already supports through exiting key combos.\n- Only a single key combo can be mapped: no support for sequence of keys.\n\n## Prerequisites / assumptions\n\nFor the premade IME:\n\n- You don't want to remap when you're in crosh window\n\nAdditionally, for the make-your-own route:\n\n- python (I use 3.x; 2.x _probably_ works)\n- [`waf` command](https://waf.io/book/#_download_and_installation)\n  - `waf*` is gitignored in this repo; I have it downloaded to the root of my local clone\n- [`jscodeshift` command](https://github.com/facebook/jscodeshift)\n  - `npm install` in this repo and add `./node_module/.bin` to `$PATH` when invoking `waf`\n  - or: `npm install -g jscodeshift`\n\n## How to install\n\nFirst, download this repo as a zip file and unpack it or clone the repo.\nChrome OS needs to have access to the file system where your local copy resides.\n\nGo to chrome://extensions and enable developer mode.\n\n### Using the premade IME\n\nIn chrome://extensions, click the \"Load unpacked extension...\" button\nand pick the `remapper` directory in your local copy of the repo.\n\nOpen Settings, then search for \"manage input methods.\" Click the highlighted row\nwith that label. There should be a row named \"US x emacs\"; check to enable it.\n\nNow, pressing \u003ckbd\u003eCtrl-Shift-Space\u003c/kbd\u003e will cycle through all the\nIMEs that are enabled. Hit \u003ckbd\u003eCtrl-Space\u003c/kbd\u003e to switch back and forth\nbetween the previously selected IME.\n\nThere's an indicator next to the notification indicator that shows the active\nIME: make sure you've activated the IME you just installed and try out\na few bindings like `C-f`, `C-b` in a text field.\n\nSee [`remapper/keymap.js`](./remapper/keymap.js) for the keybindings.\nIf you want different bindings, edit this file and reload the extension.\n\n### Making your own with a different language and/or layout\n\nYou need to create a `config.ini` file. `config.ini.sample` is a good\nstarting point:\n\n```sh\ncp config.ini.sample config.ini\n```\n\nThe config file can contain multiple sections. Each section, when\nbuilt, will result in a directory under `./build` that contains an\nIME extension.  An IME extension can potentially hold multiple\nIMEs; however, this tooling only supports a single IME per extension.\n\nHere's what a section looks like:\n\n```ini\n[us_emacs]\nname = EN x emacs\ndescription = US keyboard with emacs-like cursor movement\nlanguage = en-US\nlayout = us\nfallback_imes =\noptions_page =\n```\n\n`[us_emacs]` is the section name, which will become the name of the directory.\n\n`name` and `description` will become the name and description of both the extension\nand the IME you see in Settings.\n\n`language` and `layout` dictate which language and layout the IME will be for.\nChange these to make an IME for your preferred language and layout. I'm not sure\nwhat values are accepted here. The [extra keyboards repo][extra-keyboard] may\nbe a good resource.\n\n`fallback_imes` and `options_page` are irrelevant to what we're doing now; we'll\ncome back to it later.\n\nTo build an IME out of this config file, run `waf`:\n\n```sh\npython waf configure build\n```\n\nThis should create a directory `./build/us_emacs/`, which you can install\nlike the premade one above.\n\n### Making your own by combining other IMEs\n\nThe basic steps are the same as the above: create `config.ini` and run `waf`.\n\nThis time, we actually make use of `fallback_imes` and `options_page`.\n\n`fallback_imes` is a comma-separated list of directory names you put\nin `./imes`.  Said directories must contain an IME extension. All\nfiles in the directory will be copied to\n`build/[config_section_name]/[fallback_ime_name]/`, with `.js` files\ngetting special treatment to make all this work.\n\n`options_page` should be the path to the options page to use, relative\nto the built extension's root: `[fallback_ime_name]/options.html`, for example.\n\nHow you place an IME extension under `./imes` is up to you. You could\nclone a repo there, or symlink to a directory outside the repo.\n\nLet's see an example of how all this fits together.\n\nI want to use my emacs keybindings on top of [Chrome SKK][skk], a Japanese\nIME, so here's what I do:\n\n```\nchrome-skk/\nchrome-key-remapper/\n  config.ini\n  imes/\n    skk -\u003e ../../chrome-skk/extension\n  remapper/\n    ..\n```\n\nWith a config like:\n\n```\n[skk_remapped]\nname = SKK x emacs\ndescription = SKK with emacs-like cursor movement\nlanguage = ja\nlayout = us\nfallback_imes = skk\noptions_page = skk/options.html\n```\n\nWhen I invoke `python waf configure build`, an IME extension gets built in `./build/`:\n\n```\nchrome-key-remapper/\n  build/\n    skk_remapped/\n      manifest.json\n      remapper/\n        main.js\n        ..\n      skk/\n        main.js\n        ..\n```\n\nWith this hybrid IME enabled and active, any key event not handled by\nthe remapper will get passed onto SKK, enabling me to input Japanese\ntext while enjoying the familiar emacs-like cursor movement keys.\n\n  [extra-keyboard]: https://github.com/google/extra-keyboards-for-chrome-os\n  [skk]: https://github.com/jmuk/chrome-skk\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fento%2Fchromeos-key-remapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fento%2Fchromeos-key-remapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fento%2Fchromeos-key-remapper/lists"}