2020-12-19 15:09:24 +00:00
|
|
|
# Development
|
|
|
|
|
2020-12-19 15:12:55 +00:00
|
|
|
Contributions are very welcome, I will gladly review and discuss any merge
|
|
|
|
requests.
|
|
|
|
|
2020-12-19 15:09:24 +00:00
|
|
|
## Roadmap
|
|
|
|
|
|
|
|
- [x] show a dropdown to select valid devices
|
|
|
|
- [x] creating presets per device
|
|
|
|
- [x] renaming presets
|
|
|
|
- [x] show a mapping table
|
|
|
|
- [x] make that list extend itself automatically
|
|
|
|
- [x] read keycodes with evdev
|
|
|
|
- [x] inject the mapping
|
|
|
|
- [x] keep the system defaults for unmapped buttons
|
|
|
|
- [x] button to stop mapping and using system defaults
|
|
|
|
- [x] highlight changes and alert before discarding unsaved changes
|
|
|
|
- [x] automatically load presets on login for plugged in devices
|
|
|
|
- [x] make sure it works on wayland
|
|
|
|
- [x] support timed macros, maybe using some sort of syntax
|
|
|
|
- [x] add to the AUR, provide .deb file
|
|
|
|
- [x] basic support for gamepads as keyboard and mouse combi
|
|
|
|
- [x] executing a macro forever while holding down the key using `h`
|
|
|
|
- [x] mapping D-Pad directions as buttons
|
2020-12-19 23:41:28 +00:00
|
|
|
- [x] configure joystick purpose and speed via the GUI
|
2020-12-24 00:26:34 +00:00
|
|
|
- [x] support for non-GUI TTY environments with a command to stop and start
|
|
|
|
- [x] start the daemon in such a way to not require usermod
|
2020-12-31 20:46:57 +00:00
|
|
|
- [x] mapping a combined button press to a key
|
2020-12-19 15:15:47 +00:00
|
|
|
- [ ] mapping joystick directions as buttons, making it act like a D-Pad
|
2020-12-19 15:09:24 +00:00
|
|
|
- [ ] automatically load presets when devices get plugged in after login (udev)
|
|
|
|
- [ ] configure locale for preset to provide a different set of possible keys
|
2020-12-27 23:00:39 +00:00
|
|
|
- [ ] user-friendly way to map btn_left
|
2020-12-31 20:46:57 +00:00
|
|
|
- [ ] add "disable" as mapping option
|
2020-12-19 15:09:24 +00:00
|
|
|
|
|
|
|
## Tests
|
|
|
|
|
|
|
|
```bash
|
|
|
|
pylint keymapper --extension-pkg-whitelist=evdev
|
|
|
|
sudo pip install . && coverage run tests/test.py
|
|
|
|
coverage combine && coverage report -m
|
|
|
|
```
|
|
|
|
|
|
|
|
To read events, `evtest` is very helpful. Add `-d` to `key-mapper-gtk`
|
2020-12-19 15:12:55 +00:00
|
|
|
to get debug output.
|
|
|
|
|
|
|
|
## Releasing
|
|
|
|
|
2020-12-24 00:26:34 +00:00
|
|
|
Install dpkg or ssh/login into a debian/ubuntu environment
|
2020-12-19 15:12:55 +00:00
|
|
|
|
|
|
|
```bash
|
|
|
|
./scripts/build.sh
|
|
|
|
```
|
|
|
|
|
2020-12-24 00:26:34 +00:00
|
|
|
This will generate `key-mapper/deb/key-mapper-0.4.0.deb`
|
2020-12-19 15:12:55 +00:00
|
|
|
|
|
|
|
## Badges
|
|
|
|
|
|
|
|
```bash
|
|
|
|
sudo pip install git+https://github.com/jongracecox/anybadge
|
|
|
|
./scripts/badges.sh
|
|
|
|
```
|
|
|
|
|
2020-12-24 00:26:34 +00:00
|
|
|
New badges, if needed, will be created in `readme/` and they
|
2020-12-19 15:12:55 +00:00
|
|
|
just need to be commited.
|
2020-12-24 00:26:34 +00:00
|
|
|
|
|
|
|
## Files
|
|
|
|
|
|
|
|
**service**
|
|
|
|
|
|
|
|
- `bin/key-mapper-service` executable that starts listening over dbus for
|
|
|
|
commands and runs the injector when needed. It shouldn't matter how it is
|
|
|
|
started as long as it manages to start without throwing errors.
|
|
|
|
|
|
|
|
**gui**
|
|
|
|
|
|
|
|
- `bin/key-mapper-gtk` the executable that starts the gui. It also sends
|
|
|
|
messages to the service via dbus
|
|
|
|
- `data/key-mapper.policy` is needed to show a password promt when starting
|
|
|
|
the gui for sudo rights
|
|
|
|
- `data/key-mapper.desktop` is the entry in the start menu
|
|
|
|
|
|
|
|
**cli**
|
|
|
|
|
|
|
|
- `bin/key-mapper-control` is an executable to send messages to the service
|
|
|
|
via dbus. It can be used to start and stop injection without a gui.
|
|
|
|
|
|
|
|
**systemd**
|
|
|
|
|
|
|
|
- `data/key-mapper.service` starts key-mapper-service automatically on boot,
|
|
|
|
systemctl commands are possible.
|
|
|
|
- `data/keymapper.Control.conf` is needed to connect to dbus services started
|
|
|
|
by systemd from other applications
|
|
|
|
|
|
|
|
**user stuff**
|
|
|
|
|
|
|
|
- `key-mapper-autoload.desktop` executes on login and tells the systemd
|
|
|
|
service to stop injecting (possible the presets of another user) and to
|
|
|
|
inject the users autoloaded presets instead (if any are configured)
|
2020-12-26 15:45:29 +00:00
|
|
|
|
|
|
|
## Resources
|
|
|
|
|
|
|
|
[PyGObject API Reference](https://lazka.github.io/pgi-docs/)
|
2020-12-27 17:08:50 +00:00
|
|
|
[python-evdev](https://python-evdev.readthedocs.io/en/stable/)
|