this it's very simple. You need a software named xev if you don't jave it installed allready. With xev you can read what's the certain key code of a button (keyboard, mouse or even remote control). When you type xev in a terminal a white window with a square inside of it will open, make sure that window will allways be on top when you press a certain key to get it's key code.
When I press the key "a" this it's what i get with xev:
KeyRelease event, serial 34, synthetic NO, window 0x2c00001,
root 0xb5, subw 0x0, time 7197966, (652,-14), root
state 0x0, keycode 38 (keysym 0x61, a), same_screen YES,
XLookupString gives 1 bytes: (61) "a"
XFilterEvent returns: False
so the key code of the button a it 38 (keycode 38 as it says)
With this key code you can assign it to run any kind of command and program you want. Ok it's just like assigning a regular shortcut to a key. For example I use FluxBox as a desktop enviroment so for me to assign a shortcut to a key it can be done editing ~/.fluxbox/keys where in this kind a manner 38 :Exec tvtime so my keyboard button "a" will open tvtime.
In gnome it's even simpler because shortcuts can be assigned using you GUI and I believe it's the same with KDE.