I have two keyboards attached to my computer now, one for the sole purpose of launching other
programs when specific keys are struck.
This is input device portion of my xorg.conf file. It is set up so my input device is that of my main keyboard. This means any other keyboards attached to the PC don’t produce characters when their keys are struck.
Option “Device” “/dev/input/event4”
To catch the key presses and run specific programs upon specific key codes I used:
Below is the config file I use which means when the ‘f’ key is pressed firefox is launched.
Window “”: # Window title
“Keyboard” “” any key/33 “Shell/firefox”
(n.b. you will have to run as root unless /dev/input… is user accessible, this is obviously a bad idea, as it means any program run from it will also be root. An entry in /etc/udev/rules.d/ can be added so your user can read the device, remember this does make it easier for keyloggers to gain access to your keystrokes)