A Nim based client for a DIY macropad.
By communicating with an Arduino in the macropad, nimpad can send keyboard inputs or run shell commands.
- Linux, other platforms are not supported.
- A user in the "input" and "dialout" group. You can use sudo privileges but if you want to use this as a daemon to run shell commands, sudo is not recommended.
- Nimble packages:
serial
andlibevdev
https://www.printables.com/model/1400774-macropad
- You can get the package in my flake repository.
- Clone the repo, cd to src
- Run
nim c -r nimpad
- Edit the generated config file in your
~/.config/nimpad/config.json
. - You can also supply a config file with
-f="<path to config.json>"
, and a serial port with-p="<port>"
.- Arguments can be found by tacking
-h
or--help
- Arguments can be found by tacking
Important
Nimpad ONLY supports macropads with 10 or less keys.
If you are using Nimpad for the first time, it will create a default config file and quit. Please configure this config file before running it again as it does send keyboard inputs and run commands. Details below.
The intended way to currently configure Nimpad is by the config.json. By default, it will create the config file like so:
[
[ "KEY_ACTION", "VOLUMEDOWN" ],
[ "KEY_ACTION", "VOLUMEUP" ],
[ "KEY_ACTION", "VOLUMEMUTE" ],
[ "KEY_ACTION", "SCROLLLOCK" ],
[ "KEY_ACTION", "PREVIOUSSONG" ],
[ "KEY_ACTION", "NEXTSONG" ],
[ "KEY_ACTION", "PLAYPAUSE" ],
[ "KEY_ACTION", "" ],
[ "KEY_ACTION", "" ],
[ "KEY_ACTION", "" ]
]
- 0: Volume down
- 1: Volume up
- 2: Mute system
- 3: Scrolllock, used for Discord press-to-mute and game push-to-talk
- 4: Media previous
- 5: Media next
- 6: Media play/pause
- 7: Unused
- 8: Unused
- 9: Unused
If you don't want to use the Nimpad host client, you can find a completely standlone Arduino sketch in other