Git Product home page Git Product logo

rusty-keys's Introduction

rusty-keys

Build Status

low level keyboard mapper for linux and windows, with advanced caps lock and shift swapping behavior

This is the only keymapper I am aware of capable of implementing this layout, which I call Unix Programmer's Dvorak, which has been my daily driver since 2014:
Unix Programmer's Dvorak

The Problem

If you ever have mapped keys on linux, you know that there is the console keymap (loadkeys) and the X keymap (setxkbmap), also things like SDL and Virtualbox grab the input directly and respect no maps. Lastly I want to revert to QWERTY when holding ctrl so ctrl+c works just like normal, without remapping all programs to ctrl+j. Linux keymaps cannot do this either.

The Solution

  1. Grab a keyboard device directly so only we can read events from it.
  2. Create a new keyboard input device with uinput, this looks identical to any other keyboard device to anything running on the box.
  3. Read input_events from the real device, map them, send them to our created device.

This solution is what rusty-keys implements, it works in ttys, in X, in Wayland, in virtualbox even running windows or whatever, on SDL games, it will work literally everywhere, because rusty-keys just creates a regular keyboard.

How to run

When ran, it will read a keymap.toml configuration file, refer to example and tweak to suit.

Usage: rusty-keys [options] [device_files...]

Options:
    -h, --help          prints this help message
    -v, --version       prints the version
    -c, --config FILE   specify the keymap config file to use (default:
                        /etc/rusty-keys/keymap.toml)

when ran without specifying input devices, it maps all currently connected keyboards, and watches /dev/input/ with inotify and starts mapping any new keyboards that are plugged in forever, until you kill it: rusty-keys

or you can specify one or multiple input devices, and it will run until all are disconnected, then stop:
rusty-keys /dev/input/event0 or rusty-keys /dev/input/event0 /dev/input/event2

An example systemd service is in systemd/rusty-keys.service, enable it to have mapped keyboards all the time.

How to install

License

AGPLv3 for now, message me if you have a problem with this

Notes

Technically this is a re-implementation of a previous python program I had been using for 3 years previously.

rusty-keys's People

Contributors

moparisthebest avatar meh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.