A Linux Interception Tools' plugin to change the right Ctrl key so that the arrow keys act as Home/End/PgUp/PgDn when pressed. The right Ctrl key still acts normally when used with other keys.
Combinations work, e.g. Shift+RCtrl+→ = Shift+End, and LCtrl+RCtrl+← = Ctrl+Home.
The fn key is not a real key. It is usually implemented directly by the keyboard hardware. This only changes the behavior of the arrow keys when pressed to simulate a fn in those cases.
Some keyboards seem not to register both Ctrl keys when pressed simultaneously. This is a hardware problem.
This depends on the Interception Tools and can be used on any Linux with Wayland, X11 or in the terminal.
Build:
git clone git@github.com:gilleswaeber/ctrl2fn.git
cd ctrl2fn
cmake -Bbuild
cmake --build build
Install (into /usr/local/bin
):
sudo cmake --install build
ctrl2fn is an Interception Tools plugin.
A suggested udevmon
job configuration is:
- JOB: intercept -g $DEVNODE | ctrl2fn | uinput -d $DEVNODE
DEVICE:
EVENTS:
EV_KEY: [KEY_RIGHTCTRL, KEY_LEFT, KEY_RIGHT, KEY_UP, KEY_DOWN]
When using the daemon, the above goes in /etc/interception/udevmon.d/ctrl2fn.yaml
.
The C code is based on the space2meta plugin by Francisco Lopes da Silva, released under MIT license.
Available under MIT License, © 2021 Gilles Waeber
AutoHotkey user? This is similar to:
>^Left::Send {Home}
+>^Left::Send +{Home}
!>^Left::Send !{Home}
<^>^Left::Send ^{Home}
+<^>^Left::Send +^{Home}
>^Right::Send {End}
+>^Right::Send +{End}
!>^Right::Send !{End}
<^>^Right::Send ^{End}
+<^>^Right::Send +^{End}
>^Down::Send {PgDn}
+>^Down::Send +{PgDn}
!>^Down::Send !{PgDn}
<^>^Down::Send ^{PgDn}
+<^>^Down::Send +^{PgDn}
>^Up::Send {PgUp}
+>^Up::Send +{PgUp}
!>^Up::Send !{PgUp}
<^>^Up::Send ^{PgUp}
+<^>^Up::Send +^{PgUp}