Skip to content

c-hjkl remaps Ctrl + hjkl into arrow keys on Linux. (X11/Wayland/Console)

Notifications You must be signed in to change notification settings

stewartpark/c-hjkl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

c-hjkl

c-hjkl

c-hjkl remaps Ctrl + hjkl into arrow keys on Linux. (X11/Wayland/Console)

Why did you make this?

I've been using AutoKey on my Linux desktop to remap keys, but it has problems:

  • It stops working on Wayland.
  • It gets laggy when keys are repeatedly pressed, since it needs to run a Python script each macro keystroke.

So here I built one that solves the above problems for me. All I needed was just remapping Ctrl-H/J/K/L into arrow keys like Vim.

How does it work?

It reads and retains exclusive access to your keyboard (/dev/input/...) and creates a new UInput device(a virtual keyboard) that gets piped with the keyboard events from your actual keyboard. Then, whenever it encounters a combination it wants to override (i.e. C-hjkl), it does not forward the original key events and sends the fake key events.

Can I change the Ctrl key to something else?

No. this project's scope will be limited to C-hjkl for now. But I'll accept PRs if you make it as an option!

To do

  • Implement the basic functionality
  • Auto-detect keyboard input devices and grab them
  • Provide installable artifacts on popular Linux distros (e.g. *.deb, *.rpm, ...)

About

c-hjkl remaps Ctrl + hjkl into arrow keys on Linux. (X11/Wayland/Console)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published