This is both a simple reverse engineered doc of the Sidewinder X6 Keyboard (the macro key codes), as well as an "event machine" which triggers XEvents when a keystroke on such button is detected.
I just got a quick heads up Filip who reverse engineered the whole Sidewinder protocol and made it available on his github:
https://github.com/Wattos/LinuxSidewinderX6
Be sure to check it out, as it's a complete, fully working SidewinderX6 driver for our GNU/Linux OSes! I highly recommend it and started using it myself too. Kudos to this man! :-)
The event-gen collects data from usbmon
and grep
s it for patterns such as:
3269b9c0 0.353844 C Ii:2:005:2 0:1 5 = 08000000 00 3269b9c0 0.353951 S Ii:2:005:2 -:1 8 < 3269b9c0 0.428809 C Ii:2:005:2 0:1 5 = 08010000 00 3269b9c0 0.428913 S Ii:2:005:2 -:1 8 <
Which would mean "S01" was pressed. Then it launches the bash script contained in actions/S01.sh
.
In it we define what we want to happen on this macro-key-press.
In my opinion it's best to map these keys to ctrl+shift+F1
and such, so it's easy to map them into any app
that supports keyboard shortcuts - I do this with IntelliJ IDEA and KDE (for automating )indow management).
You'll need to install some dependencies first. For Fedora for example you'd need to do:
sudo yum install usbmon xdotool
To use the mapper you need to run (running it in the background is fine too!):
sudo ./run.sh &
Then just check out the actions/
folder and add scripts you'd like to be fired on each keystroke.
For now only keys S01 to S12 are supported. That's because the other keys need to get some info from the PC driver, that "we're going into game mode". I have not yet figured out what I should send to the keyboard in order to enable this mode. I'll do some reverse engineering of the windows driver maybe - it should help.
Thanks a lot to Bill and some other users of this keyboard - it's really great and I'm happy others think so too.
Some opinions from happy users :-)
[...]
Amazing! It works smoothly and it is not difficult to set it up to everybody's needs!
Since I'm using a lot of command line I'm remaping the keys with: xdotool type 'foo' and I'm already loving it!
Let's hack the planet! (s/planet/keyboard/g)