2023-06-22 17:13:46 +02:00
|
|
|
{ pkgs, ... }:
|
|
|
|
|
|
|
|
{
|
2023-05-16 23:18:06 +02:00
|
|
|
services.interception-tools = {
|
|
|
|
enable = true;
|
2023-06-12 19:40:56 +02:00
|
|
|
plugins = with pkgs.interception-tools-plugins; [ dual-function-keys ];
|
|
|
|
|
|
|
|
udevmonConfig = with pkgs; /* yaml */ ''
|
|
|
|
- JOB: "${interception-tools}/bin/intercept -g $DEVNODE | ${interception-tools-plugins.dual-function-keys}/bin/dual-function-keys -c /etc/dual-function-keys.yaml | ${interception-tools}/bin/uinput -d $DEVNODE"
|
2023-05-16 23:18:06 +02:00
|
|
|
DEVICE:
|
|
|
|
EVENTS:
|
|
|
|
EV_KEY: [KEY_CAPSLOCK, KEY_ESC]
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2023-06-12 19:40:56 +02:00
|
|
|
environment.etc."dual-function-keys.yaml".text = /* yaml */ ''
|
2023-05-16 23:18:06 +02:00
|
|
|
TIMING:
|
|
|
|
- TAP_MILLISEC: 1000
|
|
|
|
- DOUBLE_TAP_MILLISEC: 0
|
2023-05-23 05:01:22 +02:00
|
|
|
- SYNTHETIC_KEYS_PAUSE_MILLISEC: 0
|
2023-05-16 23:18:06 +02:00
|
|
|
MAPPINGS:
|
|
|
|
- KEY: KEY_CAPSLOCK
|
|
|
|
TAP: KEY_ESC
|
|
|
|
HOLD: KEY_LEFTCTRL
|
|
|
|
- KEY: KEY_SYSRQ
|
|
|
|
TAP: KEY_SYSRQ
|
|
|
|
HOLD: KEY_RIGHTMETA
|
2023-05-23 23:10:42 +02:00
|
|
|
- KEY: KEY_RIGHTSHIFT
|
|
|
|
TAP: [ KEY_LEFTMETA, KEY_F2 ]
|
|
|
|
HOLD: KEY_RIGHTSHIFT
|
2023-05-16 23:18:06 +02:00
|
|
|
'';
|
|
|
|
}
|