I find this kind of keyboard remapping essential when using a laptop now that I'm used to using an external keyboard with QMK firmware at my desk (though these days I use Kmonad).
This is fantastic. Works perfectly right off the bat. I have so much trouble just getting capslock to be control consistently in Linux, and this made it easy.
I wish window/app selection in Wayland was better. On my Mac I use a combination of Phoenix and Hyperkey to capture capslock + key combinations, (e.g. cap+f for Firefox) which when pressed, either open an app of my choice it not already open, or bring it to the front of the stack.
Last time I looked into it window and app selection in Wayland just didn’t work.
I use https://github.com/houmain/keymapper to achieve the same thing, Meta + W: open or switch through existing Firefox windows, Meta + Z: open or switch through existing Terminal Windows, etc.
It works on Wayland from my understanding, but I'm using X11 as my daily driver.
This is one of many things that used to be easier before wayland
You can get pretty far with just the xkbd definions though, although you need root to reconfigure it.
A bit ironically, the easiest way I've found to create xkbd definions is to start an X11 server, reconfigure your xmodmap+xcompose, and export the current xkbd settings. Xmodmap is much easier to edit than editing xkbd directly.
I've done nearly the same thing and have called it 'keyd' as well.
It's a little more inspired by a "djb" style design. Instead of having a configuration file, the program takes a single argument which is meant to be a directory. Then, if code 113 is pressed, it looks for an executable file named '113' in the given directory and if it exists will execute it. If not found it then tries '113+', then on release it will try '113-'.
I use Karabiner-Elements on macOS, and finding keyd was a godsend on Linux. I cannot deal with standard keyboard mappings and the lack of hold/tap keys.
Great software. Especially the "lettermod" feature. It allows you to configure a key to switch to a layer / secondary actions if held for some time, but only if no other key was pressed within some time before. So secondary key actions don't happen while the user is actively typing a text. This makes it very easy to add homerow mods (adding Ctrl, Alt, etc to the homerow keys) without the struggle of accidently triggering them.
I have been using this for a while and it's great. Here's my config
[main]
# Maps capslock to escape when pressed and control when held.
capslock = overload(control, esc)
# Maps left meta to alt+f1 when tapped alone for start menu
leftmeta = overload(meta, macro(A-f1))
# Makes a shift layer
[shift]
leftshift = capslock
rightshift = capslock
# i.e, when some shift is pressed down, the other shift being pressed will yield a capslock.
# So, press lshift+rshift for capslock
24 comments
[ 2.7 ms ] story [ 40.0 ms ] threadBut I didn't find any cool use case for it, what do you use it for ?
I actually use keyd on my laptops because it seems to do everything I need and is easy to get going without any fuss. So thank you Raheman Vaiya.
I wish window/app selection in Wayland was better. On my Mac I use a combination of Phoenix and Hyperkey to capture capslock + key combinations, (e.g. cap+f for Firefox) which when pressed, either open an app of my choice it not already open, or bring it to the front of the stack.
Last time I looked into it window and app selection in Wayland just didn’t work.
It works on Wayland from my understanding, but I'm using X11 as my daily driver.
You can get pretty far with just the xkbd definions though, although you need root to reconfigure it.
A bit ironically, the easiest way I've found to create xkbd definions is to start an X11 server, reconfigure your xmodmap+xcompose, and export the current xkbd settings. Xmodmap is much easier to edit than editing xkbd directly.
Yes, I would certainly expect much less than 1ms. Perhaps 1µs should be the goal?
It's a little more inspired by a "djb" style design. Instead of having a configuration file, the program takes a single argument which is meant to be a directory. Then, if code 113 is pressed, it looks for an executable file named '113' in the given directory and if it exists will execute it. If not found it then tries '113+', then on release it will try '113-'.
[0] https://gitlab.com/interception/linux/tools
Can something like that be done with `keyd`?
[1] https://github.com/kmonad/kmonad