All Projects → ento → chromeos-key-remapper

ento / chromeos-key-remapper

Licence: MIT license
IME / tooling for remapping key combos to other key combos on Chrome OS

Programming Languages

javascript
184084 projects - #8 most used programming language
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to chromeos-key-remapper

Lipika Ime
Input Method Engine (IME) for Mac OS X with built-in support for all Indic Languages
Stars: ✭ 76 (+162.07%)
Mutual labels:  keyboard, ime
Teleprinter
The missing Android keyboard API
Stars: ✭ 33 (+13.79%)
Mutual labels:  keyboard, ime
my-ime2
A Shuangpin IME for Chrome OS
Stars: ✭ 28 (-3.45%)
Mutual labels:  ime, chromeos
govarnam
Easily Type Indian Languages on computer and mobile. GoVarnam is a cross-platform transliteration library. Manglish -> Malayalam, Thanglish -> Tamil, Hinglish -> Hindi plus another 10 languages. GoVarnam is a near-Go port of libvarnam
Stars: ✭ 97 (+234.48%)
Mutual labels:  keyboard, ime
NavilIME
Windows Hangul (Korean) Input Method Editor based on TSF
Stars: ✭ 79 (+172.41%)
Mutual labels:  keyboard, ime
Juni
12 Keys Chorded keyboard layout
Stars: ✭ 51 (+75.86%)
Mutual labels:  keyboard
gotomation
No description or website provided.
Stars: ✭ 18 (-37.93%)
Mutual labels:  keyboard
kindaVim.theapp
Ultimate Vim Mode for macOS
Stars: ✭ 372 (+1182.76%)
Mutual labels:  keyboard
prk firmware
A keyboard firmware platform in PicoRuby
Stars: ✭ 337 (+1062.07%)
Mutual labels:  keyboard
ng-virtual-keyboard
Virtual Keyboard for Angular applications
Stars: ✭ 25 (-13.79%)
Mutual labels:  keyboard
chromeos.dev
chromeOS.dev is the digital home for all things Chrome OS. Learn how to adapt and optimize your existing apps to work on Chrome OS, the success other companies have had doing so, how to use Chrome OS as your developer machine, and keep up-to-date with the latest on Chrome OS.
Stars: ✭ 150 (+417.24%)
Mutual labels:  chromeos
Onion Rime Files
電腦 Rime 洋蔥方案(注音、雙拼、拼音、形碼、行列30)
Stars: ✭ 88 (+203.45%)
Mutual labels:  ime
Ayase
🥥 Control everything by keyboard. Built for hackers and the blind.
Stars: ✭ 53 (+82.76%)
Mutual labels:  keyboard
python-keylogger
Advanced Pure-Python Keylogger
Stars: ✭ 64 (+120.69%)
Mutual labels:  keyboard
L5P-Keyboard-RGB
Cross platform software to control the lighting of the 4 zone keyboard included in the 2020 and 2021 lineup of the Lenovo Legion laptops. Works on Windows and Linux.
Stars: ✭ 79 (+172.41%)
Mutual labels:  keyboard
kalamine
Keyboard Layout Maker
Stars: ✭ 47 (+62.07%)
Mutual labels:  keyboard
xcloud-keyboard-mouse
Chrome extension for controlling Xbox Cloud Gaming (Project xCloud) using a keyboard and mouse
Stars: ✭ 78 (+168.97%)
Mutual labels:  keyboard
buildlogs
Repository to document my builds and projects.
Stars: ✭ 84 (+189.66%)
Mutual labels:  keyboard
iterm2-macos-dynamic-profile
🍎Fix iterm2 macos keys
Stars: ✭ 69 (+137.93%)
Mutual labels:  keyboard
Lotus58
A 58 key split ergo linear keyboard derived from the Lily58 family
Stars: ✭ 142 (+389.66%)
Mutual labels:  keyboard

chromeos-key-remapper

This repo contains:

  1. An unpublished Chrome OS IME that lets you use emacs-like cursor movement keys with a US English keyboard. C-a and C-k, to name a few.
  2. Tooling to build a custom IME that combines the remapper engine and other 3rd party IMEs.

Limitations

  • All the combined IMEs share the same JavaScript scope. Name collision can happen.
  • The options page of the custom IME can only display the options page of a single IME.
  • Keys can be only remapped to other key combinations. i.e. can't do things that the OS already supports through exiting key combos.
  • Only a single key combo can be mapped: no support for sequence of keys.

Prerequisites / assumptions

For the premade IME:

  • You don't want to remap when you're in crosh window

Additionally, for the make-your-own route:

  • python (I use 3.x; 2.x probably works)
  • waf command
    • waf* is gitignored in this repo; I have it downloaded to the root of my local clone
  • jscodeshift command
    • npm install in this repo and add ./node_module/.bin to $PATH when invoking waf
    • or: npm install -g jscodeshift

How to install

First, download this repo as a zip file and unpack it or clone the repo. Chrome OS needs to have access to the file system where your local copy resides.

Go to chrome://extensions and enable developer mode.

Using the premade IME

In chrome://extensions, click the "Load unpacked extension..." button and pick the remapper directory in your local copy of the repo.

Open Settings, then search for "manage input methods." Click the highlighted row with that label. There should be a row named "US x emacs"; check to enable it.

Now, pressing Ctrl-Shift-Space will cycle through all the IMEs that are enabled. Hit Ctrl-Space to switch back and forth between the previously selected IME.

There's an indicator next to the notification indicator that shows the active IME: make sure you've activated the IME you just installed and try out a few bindings like C-f, C-b in a text field.

See remapper/keymap.js for the keybindings. If you want different bindings, edit this file and reload the extension.

Making your own with a different language and/or layout

You need to create a config.ini file. config.ini.sample is a good starting point:

cp config.ini.sample config.ini

The config file can contain multiple sections. Each section, when built, will result in a directory under ./build that contains an IME extension. An IME extension can potentially hold multiple IMEs; however, this tooling only supports a single IME per extension.

Here's what a section looks like:

[us_emacs]
name = EN x emacs
description = US keyboard with emacs-like cursor movement
language = en-US
layout = us
fallback_imes =
options_page =

[us_emacs] is the section name, which will become the name of the directory.

name and description will become the name and description of both the extension and the IME you see in Settings.

language and layout dictate which language and layout the IME will be for. Change these to make an IME for your preferred language and layout. I'm not sure what values are accepted here. The extra keyboards repo may be a good resource.

fallback_imes and options_page are irrelevant to what we're doing now; we'll come back to it later.

To build an IME out of this config file, run waf:

python waf configure build

This should create a directory ./build/us_emacs/, which you can install like the premade one above.

Making your own by combining other IMEs

The basic steps are the same as the above: create config.ini and run waf.

This time, we actually make use of fallback_imes and options_page.

fallback_imes is a comma-separated list of directory names you put in ./imes. Said directories must contain an IME extension. All files in the directory will be copied to build/[config_section_name]/[fallback_ime_name]/, with .js files getting special treatment to make all this work.

options_page should be the path to the options page to use, relative to the built extension's root: [fallback_ime_name]/options.html, for example.

How you place an IME extension under ./imes is up to you. You could clone a repo there, or symlink to a directory outside the repo.

Let's see an example of how all this fits together.

I want to use my emacs keybindings on top of Chrome SKK, a Japanese IME, so here's what I do:

chrome-skk/
chrome-key-remapper/
  config.ini
  imes/
    skk -> ../../chrome-skk/extension
  remapper/
    ..

With a config like:

[skk_remapped]
name = SKK x emacs
description = SKK with emacs-like cursor movement
language = ja
layout = us
fallback_imes = skk
options_page = skk/options.html

When I invoke python waf configure build, an IME extension gets built in ./build/:

chrome-key-remapper/
  build/
    skk_remapped/
      manifest.json
      remapper/
        main.js
        ..
      skk/
        main.js
        ..

With this hybrid IME enabled and active, any key event not handled by the remapper will get passed onto SKK, enabling me to input Japanese text while enjoying the familiar emacs-like cursor movement keys.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].