Skip to content

Remap right ctrl+arrow as home/end/pgup/pgdn for Linux

License

Notifications You must be signed in to change notification settings

gilleswaeber/ctrl2fn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ctrl2fn

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.

Installation

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

Execution

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.

Thanks

The C code is based on the space2meta plugin by Francisco Lopes da Silva, released under MIT license.

License

Available under MIT License, © 2021 Gilles Waeber

Other platforms

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}

About

Remap right ctrl+arrow as home/end/pgup/pgdn for Linux

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published