this will kill your app, zsnes in my example
2. edit keymap in /usr/share/xbmc/system/keymaps/remote.xml
choose your key which will be execute script and add launch for script
i choose mute key
3. save and test
If you have better idea tell it and don't forget give your results.