petrockblog
Keymaster
Post count: 1827

[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.