Skip to content

kozikow/keyremaplinux

Repository files navigation

Introduction

Define your keyboard layout as C++ class. Primarily focused on implementing my keyboard layout.

Why use it instead of xmodmap/xcape

  • Just single representation for a key to deal with - input_event code from input_event_codes.h. No need to distinguish between scancode, keysym or keycode.
  • For complex layouts, xmodmap/xcape gets hard to maintain: https://github.com/kozikow/kozikow-layout-linux.
  • Thread per keyboard lets you have different layout per keyboard.
  • Unit test your layout.

Installation

Build keyremaplinux

git clone https://github.com/kozikow/keyremaplinux ~/keyremaplinux
cd ~/keyremaplinux
bazel build //keyremaplinux

Running on Linux

Run one-of:

sudo nice -n -20 ./bazel-bin/keyremaplinux/keyremaplinux kozikow_standard

Enable automatic restarts

sudo cp keyremaplinux.service /etc/systemd/system
sudo systemctl enable keyremaplinux.service
sudo systemctl restart keyremaplinux.service

Implementing the new layout

  1. Extend Remapper and implement function Remap.
  2. For example KozikowLayoutRemapper.
  3. In function Remap, consume and produce Linux input event from input.h. What you consume is what user have typed. What you produce is what OS will see.
  4. Event codes are defined in input-event-codes.h

Run tests

bazel test //keyremaplinux:all --test_output=errors

About

Define your keyboard layout as C++ class.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published