#joy.cfg #format: # [keycode from /usr/include/linux/input.h] [whitespace] [GPIO pin no] # Not limited to a single key. A GPIO press will emit all defined keys in order. #KEY_LEFT 0 #KEY_RIGHT 1 #KEY_UP 4 #KEY_DOWN 7 #KEY_W 0 #KEY_A 5 #KEY_S 6 #KEY_D 7 #KEY_1 8 #KEY_2 9 #KEY_3 10 #KEY_4 11 #KEY_5 14 #KEY_6 15 #KEY_7 17 #KEY_8 18 #KEY_9 21 #KEY_0 22 #KEY_MINUS 23 #KEY_EQUAL 24 #KEY_ESC 25 #KEY_H 21 #KEY_E 21 #KEY_L 21 #KEY_L 21 #KEY_O 21 # Set up a rotary encoder generating up & down arrow keys, using GPIOs 4 and 17 for gray code input ROT 5 6 KEY_LEFT KEY_RIGHT KEY_ENTER 13 KEY_SPACE 16 KEY_BACKSPACE 20 #define I/O expanders before using them #XIO(tag) gpio_int_pin/chip_addr:register_no #MCP23008 only has a single 8-bit bank #XIO_M 17/0x20/MCP23008 #define an MCP23008 expander at address 0x20 with interrupt wired to GPIO-17 #MCP23017 has two 8-bit banks #XIO_A 17/0x20/MCP23017A #XIO_B 17/0x20/MCP23017B #KEY_O XIO_M:1 #KEY_L XIO_M:2 #KEY_E XIO_A:6 #KEY_E XIO_B:6