supersirlink
Participant
Post count: 42

If all you want is ESC, try this:

if (confres.button_enabled) {
                        btn_read(&button);

                        switch (button.state) {
                        case BTN_STATE_IDLE:
                                break;
                        case BTN_STATE_PRESSED:
                                if (button.pressedCtr == 1 && button.duration >= 1) {
                                        uinput_kbd_write(&uinp_kbd, KEY_ESC, 1, EV_KEY);
                                }
                                break;
                        case BTN_STATE_RELEASED:
                                        if (button.pressedCtr == 1 && button.duration >= 1) {
                                                uinput_kbd_write(&uinp_kbd, KEY_ESC, 0, EV_KEY);
                                        }
                                break;
                        }
                }

                /* wait for some time to keep the CPU load low */