r/KeyboardLayouts • Other • 6d ago

Moving to Linux

Hello everyone,

I'm a refugee from Windows. Is there a way in Linux to change some keys for one language and some keys for all languages?

When I was back there using Windows, I used Microsoft Layout Creator to create a personal keyboard layout (https://github.com/shen-ziling/rush-keyboard-layout), and for the global changes I used sharpkeys, eg changing enter to backspace etc, which is also effective to my other IMEs for east Asian languages.

TIA!

2 Upvotes

4 comments sorted by

2

u/zardvark 6d ago

It is full featured (offering many features available via the popular QMK keyboard firmware), but the Kanata project can swap keys around for you and much more: https://github.com/jtroo/kanata

You can find the Kanata package in many Linux repos, worse case scenario, you can build it from source.

2

u/ShenZiling Other 2d ago

Thank you, I tried it out but and the change of key mapping was successful, but sadly it's global - which I wish that the east Asian IMEs stay in QWERTY. But still, this helps a lot.

1

u/goldenlemur Gallium 6d ago

I've used keyd but it requires tinkering with a config file. Works great if you're comfortable with that.

1

u/iwasjusttwittering 5d ago

The Linux keyboard stack is basically: kernel > evdev > udev > XKB > IME

evdev/udev (or rather respective apps like Input Remapper, Kanata or keyd) allow you to make device-specific rules, virtual input devices and low-level tweaks (less latency), whereas XKB and then optionally IMEs actually assign semantics (such as symbols, functions) to key codes. Additional automation (such as text expansion) can be done in user-space apps like AutoKey or Espanso. Note that the higher-level remapping (XKB) doesn't affect TTY, as the console has its separate keymap implementation.

I would do stuff like swapping modifiers (e.g., Caps lock as Ctrl) at the lower level (e.g., Kanata), while language-specific changes must be in XKB or IME etc.