zsugabubus / interception-k2k

Configurable plugin for Interception Tools (caps2esc, space2meta, tab2altgr...)
GNU General Public License v3.0
53 stars 11 forks source link
evdev interception-tools keyboard-shortcuts uinput xcape

interception-k2k

All-in-one input key mapper for Interception Tools.

Configuration

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.

This repository contains the following example configurations:

caps2esc

This maps caps lock to esc when tapped and to left control when held.

ctrl-meta-lock

control locks when both keys are pressed together. The same for meta.

disable-keys

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.

home-row-mods

Mapping a,s,d,f,j,k,l,; and space to control, alt, meta and shift when held.

media-keys

left meta key combinations as media keys.

qwerty-ws

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).

shift2caps

This toggles caps lock when both shift keys are pressed together.

vim-overlay-dvorak

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.

udevmon.yaml

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.

Installation

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