gsauthof / shift-tutor

Filter suboptimal shift key combinations on Linux

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This repository contains shift-tutor, a small Python script that filters suboptimal shift key combinations, on Linux.

That way it helps to train muscle memory for using both shift keys when touch typing.

It might also serve as a concise example of how keyboard events can be easily read, filtered, manipulated and injected on Linux.

See also my blog article on shift-tutor.

2023, Georg Sauthoff

Usage

On Fedora, install dependencies:

dnf install python3-evdev

List all available keyboards:

shift-tutor.py -l

Actively filter a certain keyboard:

shift-tutor.py /dev/...

Or by name:

shift-tutor.py --name 'Some Keyboard Name'

Note that the script requires root privileges.

How it works

It uses the Linux evdev API to exclusively grab a keyboard and inject a subset of the arriving keycodes back to the system, using the Linux uinput API, via a virtual keyboard.

For accessing these APIs from Python, shift-tutor uses the fine python-evdev package.

About

Filter suboptimal shift key combinations on Linux


Languages

Language:Python 100.0%