Homepage › Forums › RetroPie Project › Everything else related to the RetroPie Project › Change RetroPie GPIO button coding to 1 press › Reply To: Change RetroPie GPIO button coding to 1 press
12/10/2013 at 07:33
#3525
Keymaster
[quote=3493]Florian, can we put a key combination in the code, like say KEY_ALT+ESC, or KEY_ALT+H?[/quote]
I have not tried this myself, but I would guess that something like
case BTN_STATE_PRESSED:
if (button.pressedCtr == 1 && button.duration >= 1) {
uinput_kbd_write(&uinp_kbd, KEY_LEFTALT, 1, EV_KEY);
uinput_kbd_write(&uinp_kbd, KEY_H, 1, EV_KEY);
}
break;
case BTN_STATE_RELEASED:
if (button.pressedCtr == 1 && button.duration >= 1) {
uinput_kbd_write(&uinp_kbd, KEY_LEFTALT, 0, EV_KEY);
uinput_kbd_write(&uinp_kbd, KEY_H, 0, EV_KEY);
}
break;
could work.
See, e.g., http://www.cs.fsu.edu/~baker/devices/lxr/http/source/linux/include/linux/input.h?v=2.6.11.8#L164 for a complete list of key codes.