Generating other key combinations

You can create several different key mappings in your file to support different programs. For instance, the events_z80 key mapping would be useful for a spectrum emulator, such as Fuse (browse to http://raspi.tv/2012/how-to-install-fuse-zx-spectrum-emulator-on-raspberry-pi for more details). The events_omx key mappings are suitable for controlling video played through the OMXPlayer using the following command:

omxplayer filename.mp4  

You can get a list of keys supported by omxplayer by using the -k parameter.

Replace the line that defines the events list with a new key mapping, and select different ones by assigning them to events using the following code:

events_dpad = (uinput.KEY_UP,uinput.KEY_DOWN,uinput.KEY_LEFT, 
              uinput.KEY_RIGHT,uinput.KEY_ENTER,uinput.KEY_ENTER) 
events_z80 = (uinput.KEY_Q,uinput.KEY_A,uinput.KEY_O, 
             uinput.KEY_P,uinput.KEY_M,uinput.KEY_ENTER) 
events_omx = (uinput.KEY_EQUAL,uinput.KEY_MINUS,uinput.KEY_LEFT, 
             uinput.KEY_RIGHT,uinput.KEY_P,uinput.KEY_Q) 

You can find all the KEY definitions in the input.h file; you can view it using the less command (press Q to exit), as shown in the following command:

less /usr/include/linux/input.h