The default buttons->keypresses will be satisfactory for most projects. However, you may want to customize those keys so when a GPIO pin is pulled to ground, a different keystroke is sent. It isn't that difficult to do! However, you will need an FTDI Friend or USB console cable to connect the EZ-Key to your computer.
You will have to put the EZ-Key into re-mapping mode. To do this, the pair-button must be pressed while the module is powered up. The easiest way to do this is to disconnect the red Vin wire from the console cable, press down on the button, then plug in the red wire, that's it!
You'll also need to download and install the ControlP5 library
Then click below to download the remap software
in the line
myPort = new Serial(this, "COM3", 9600);Change "COM3" to whatever the cable name is. Again, for Mac or Linux it will probably be /dev/cu.something
Replug in the FTDI/Console cable.
Select File->Run again to start the script with the correct /dev or COM port
Now disconnect the red wire that is powering the EZ-Key, press and hold the Pair button on the module and reconnect the red wire. You should see:
Adafruit Bluefruit HID 9/18/2013
Appear in the bottom half of the screen. Now click that large gray square window to remap
Indicating that the mapping was sent.
OK now you want to actually change the key report. Each of the 12 keys has a report. This is an example for #0:
hid_keys.set_key_report(0, MODIFIER_NONE, KEY_A, KEY_NONE, KEY_NONE, KEY_NONE, KEY_NONE, KEY_NONE);
There are 8 'arguments' to each report:
The first one is the GPIO#, in this case its #0.
Second is the modifier keys, such as Shift, Control, Alt, etc. See hid_keys.pde for a list of the modifier available. You can 'or' the modifiers. For example, if you want to press shift and control modifiers at the same time, use MODIFIER_SHIFT_LEFT | MODIFIER_CONTROL_LEFT
The last 6 are the 6 slots available for concurrent keys. You can have up to 6 key-codes sent at once (handy for when you want to send complex key reports. Check hid_keys.pde for the list of all the keycodes!