2020-11-26 20:37:15 +00:00
|
|
|
<h1 align="center">Key Mapper</h1>
|
2020-10-26 22:45:22 +00:00
|
|
|
|
2020-11-27 20:31:58 +00:00
|
|
|
<p align="center">A Linux tool to change and program the mapping of your input device buttons.</p>
|
2020-11-26 20:37:15 +00:00
|
|
|
|
2020-11-29 12:55:37 +00:00
|
|
|
<p align="center">
|
2020-11-29 13:07:25 +00:00
|
|
|
<a href="#ubuntudebian">Ubuntu/Debian</a> • <a href="#manjaroarch">Manjaro/Arch</a> • <a href="#git">Git</a>
|
2020-11-29 12:55:37 +00:00
|
|
|
</p>
|
|
|
|
|
2020-11-26 23:36:05 +00:00
|
|
|
<p align="center"><img src="readme/pylint.svg"/> <img src="readme/coverage.svg"/></p>
|
2020-11-16 12:01:42 +00:00
|
|
|
|
2020-11-29 09:42:20 +00:00
|
|
|
<p align="center"><img src="readme/screenshot.png"/></p>
|
2020-11-26 23:00:21 +00:00
|
|
|
<br/>
|
2020-10-31 18:21:17 +00:00
|
|
|
|
2020-11-26 20:37:15 +00:00
|
|
|
## Usage
|
2020-11-01 20:32:06 +00:00
|
|
|
|
2020-11-29 13:07:25 +00:00
|
|
|
After installing, you should log out and back in for the changed user
|
|
|
|
groups to take effect and for the background service to start.
|
2020-11-22 21:03:44 +00:00
|
|
|
|
2020-11-29 13:07:25 +00:00
|
|
|
To open the UI to modify the mappings, look into your applications menu
|
|
|
|
and search for 'Key Mapper' in settings. You can also start it via
|
|
|
|
`key-mapper-gtk`. It works with both Wayland and X11.
|
2020-11-29 12:55:37 +00:00
|
|
|
|
2020-11-27 20:27:15 +00:00
|
|
|
## Macros
|
|
|
|
|
|
|
|
It is possible to write timed macros into the center column:
|
2020-11-28 21:59:07 +00:00
|
|
|
- `k(1).k(2)` 1, 2
|
|
|
|
- `r(3, k(a).w(500))` a, a, a with 500ms pause
|
|
|
|
- `m(Control_L, k(a).k(x))` CTRL + a, CTRL + x
|
2020-11-27 20:27:15 +00:00
|
|
|
|
|
|
|
Documentation:
|
2020-11-28 19:28:15 +00:00
|
|
|
- `r` repeats the execution of the second parameter
|
2020-11-28 21:54:22 +00:00
|
|
|
- `w` waits in milliseconds
|
2020-11-28 19:28:15 +00:00
|
|
|
- `k` writes a single keystroke
|
|
|
|
- `m` holds a modifier while executing the second parameter
|
2020-11-27 20:31:03 +00:00
|
|
|
- `.` executes two actions behind each other
|
2020-11-27 20:27:15 +00:00
|
|
|
|
2020-11-28 22:44:40 +00:00
|
|
|
For a list of supported keystrokes and their names, check the output of
|
|
|
|
`xmodmap -pke`
|
2020-11-27 20:31:58 +00:00
|
|
|
|
2020-11-29 12:55:37 +00:00
|
|
|
## Installation
|
|
|
|
|
2020-11-29 13:07:25 +00:00
|
|
|
##### Ubuntu/Debian
|
2020-11-29 12:55:37 +00:00
|
|
|
|
|
|
|
```bash
|
2020-11-29 13:07:25 +00:00
|
|
|
sudo dpkg -i $(wget TODO)
|
2020-11-29 13:25:44 +00:00
|
|
|
sudo usermod -a -G plugdev,input $USER
|
2020-11-29 12:55:37 +00:00
|
|
|
```
|
|
|
|
|
2020-11-29 13:07:25 +00:00
|
|
|
##### Manjaro/Arch
|
2020-11-29 12:55:37 +00:00
|
|
|
|
|
|
|
```bash
|
|
|
|
pacaur -S key-mapper-git
|
|
|
|
```
|
|
|
|
|
2020-11-29 13:07:25 +00:00
|
|
|
##### Git
|
2020-11-22 21:03:44 +00:00
|
|
|
|
|
|
|
```bash
|
2020-11-26 20:37:15 +00:00
|
|
|
git clone https://github.com/sezanzeb/key-mapper.git
|
2020-11-29 15:21:52 +00:00
|
|
|
cd key-mapper && sudo pip install .
|
2020-11-29 13:25:44 +00:00
|
|
|
sudo usermod -a -G plugdev,input $USER
|
2020-11-01 20:32:06 +00:00
|
|
|
```
|
|
|
|
|
2020-11-26 20:37:15 +00:00
|
|
|
## Tests
|
2020-11-01 20:32:06 +00:00
|
|
|
|
2020-11-02 19:55:17 +00:00
|
|
|
```bash
|
2020-11-22 20:41:29 +00:00
|
|
|
pylint keymapper --extension-pkg-whitelist=evdev
|
2020-11-29 15:21:52 +00:00
|
|
|
sudo pip install . && python3 tests/test.py
|
2020-11-01 20:32:06 +00:00
|
|
|
```
|
2020-11-01 19:19:50 +00:00
|
|
|
|
2020-11-26 20:37:15 +00:00
|
|
|
## Roadmap
|
2020-10-26 22:45:22 +00:00
|
|
|
|
2020-11-22 21:03:44 +00:00
|
|
|
- [x] show a dropdown to select valid devices
|
2020-11-19 00:45:12 +00:00
|
|
|
- [x] creating presets per device
|
|
|
|
- [x] renaming presets
|
2020-11-22 21:03:44 +00:00
|
|
|
- [x] show a mapping table
|
2020-11-15 11:15:58 +00:00
|
|
|
- [x] make that list extend itself automatically
|
2020-11-22 21:03:44 +00:00
|
|
|
- [x] read keycodes with evdev
|
|
|
|
- [x] inject the mapping
|
2020-11-10 22:21:19 +00:00
|
|
|
- [x] keep the system defaults for unmapped buttons
|
2020-11-19 00:45:12 +00:00
|
|
|
- [x] button to stop mapping and using system defaults
|
2020-11-15 00:35:35 +00:00
|
|
|
- [x] highlight changes and alert before discarding unsaved changes
|
2020-11-26 23:00:21 +00:00
|
|
|
- [x] automatically load presets on login for plugged in devices
|
2020-11-22 20:43:22 +00:00
|
|
|
- [x] make sure it works on wayland
|
2020-11-28 23:28:46 +00:00
|
|
|
- [x] support timed macros, maybe using some sort of syntax
|
2020-11-29 12:55:37 +00:00
|
|
|
- [ ] add to the AUR, provide .deb file
|
2020-11-26 23:00:21 +00:00
|
|
|
- [ ] automatically load presets when devices get plugged in after login
|