All-in-one input key mapper for Interception Tools.
User configuration files can be placed under subdirectories of examples
directory, or in a new dir next to it. Executables will be generated per subdirectory, so you can easily manage your rules if you need more instances of interception-k2k
.
- For simple 1-to-1 mappings, use
map-rules.h.in
.- If you want to disable a key, map it to
KEY_RESERVED
.
- If you want to disable a key, map it to
- For many-to-1, use
multi-rules.h.in
. - Note that there is no way to map a single key input to output multiple keys. Use dual-function-keys for that.
- For different behavior when a key is tapped and when it's held, use
tap-rules.h.in
.
This repository contains the following example configurations:
This maps caps lock to esc when tapped and to left control when held.
control locks when both keys are pressed together. The same for meta.
This lets you disable certain keys that you have mapped elsewhere, forcing you to adjust to their new location. If you are chaining configurations, make sure you disable first, then add the new mapping.
Mapping a,s,d,f,j,k,l,; and space to control, alt, meta and shift when held.
left meta key combinations as media keys.
This remaps the right half of an ANSI laptop keyboard after you have moved around some of its keycaps for a WideSym mod (inspired by DreymaR's Colemak-CAWS).
This toggles caps lock when both shift keys are pressed together.
Holding e activates vim-like functions on the right side of the keyboard, and holding i activates some on the left. Note that the keys are remapped to match the location of keys on the Dvorak keyboard layout instead of qwerty.
If you wish to try out one or more of these example configurations, copy udevmon.yaml
to /etc/interception/
. Multiple configurations can be chained in that yaml:
- JOB: "intercept -g $DEVNODE | /opt/interception/caps2esc | /opt/interception/shift2caps | uinput -d $DEVNODE"
DEVICE:
EVENTS:
EV_KEY: [KEY_CAPSLOCK, KEY_ESC, KEY_SPACE]
Note that performance-wise it may be a good idea to combine your configurations in a single executable (i.e. subfolder) instead of chaining multiple configurations.
git clone https://github.com/zsugabubus/interception-k2k &&
cd interception-k2k &&
make &&
make install
By default make
builds all configurations in the examples
directory. Add CONFIG_DIR=<your new dir>
if you created a new dir that only contains your configurations to prevent make install
from installing any examples you might not plan on using.
By default make install
copies the executables to /opt/interception
. Add INSTALL_DIR=<somehwere else>
if you want to change that.
All together this may look like:
make clean
make CONFIG_DIR=in
sudo make install CONFIG_DIR=in INSTALL_DIR=/usr/bin