Skip to content

SpaceFN for Linux with tapping for dedicated arrow keys

License

Notifications You must be signed in to change notification settings

hoanglongcao/spacefn-tap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 

Repository files navigation

spacefn-tap

SpaceFN for Linux with tapping for dedicated arrow keys especially for 60% keyboard.

SpaceFN-Tap is adapted from abrasive/spacefn-evdev with tapping for dedicated arrow keys inspired from Anne Pro 2.

If you have an Anne Pro 2, check this thread.

I did not spend much time on this code so it does not look clean.

Image of SpaceFN-tab

SpaceFN history and Anne Pro 2 Tap

The story started from here: https://geekhack.org/index.php?topic=51069.0

Image of SpaceFN

Keys at the second layer are not the same in my code. It is personal so choose your own preference.

Image of Anne Pro 2 Tap

Tapping function

I use KEY_RIGHTSHIFT, KEY_COMPOSE, KEY_RIGHTALT and KEY_RIGHTCTRL for KEY_UP, KEY_DOWN, KEY_LEFT and KEY_RIGHT. All these four keys should work with their normal functionalities when being pressed and held.

spacefn-tap mimics Anne Pro 2 tap mode but not exactly the same when 4 decidated arrow keys are pressed and held. So it is better to use the KEY_LEFTCTRL and KEY_LEFTALT when KEY_RIGHTCTRL and KEY_RIGHTALT are used for the tap mode. For example to perform ALT + F4 you should do KEY_LEFTALT + KEY_SPACE + KEY_4. KEY_LEFTALT + KEY_4 does not work at this moment.

Depending on your keyboard layout, you might need to swap these keys either by software or hardware (rewiring, check this thread).

Check function key_remap(). I change \| to KEY_DELETE. Note that I also change ~to KEY_ESC to test on my TKL. Comment out this key if you have a real 60% keyboard.

Compile and Run

Requirement: libudev

make

sudo ./spacefn-tab /dev/input/by-id/usb-XXX-event-kbd

Find your keyboard ID in /dev/input/by-id (for USB) and /dev/input/by-path (for PS/2).

sudo ./spacefn-tab /dev/input/by-id/usb   then press Tab twice to list all input devices 

sudo ./spacefn-tab /dev/input/by-path/    then press Tab twice to list all input devices

After runing, there is a bug that "new lines" are running continously in the console due to the library. You just need to press any key and it should be fine to use.

Modification

You can customize by using key_map() as the original spacefn-evdev version. You can also add new layers.

Check this page to find keycode for Linux system: input-event-codes.h.

Most of the keycodes are compatible with my keyboards. If not, detect key pressed by sudo showkey

About

SpaceFN for Linux with tapping for dedicated arrow keys

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published