More buttons!

This commit is contained in:
Denis 2023-11-09 00:05:43 +01:00
parent 24ccf276f2
commit 65fb14fcd1
No known key found for this signature in database
GPG key ID: DD9B63F805CF5C03

View file

@ -156,7 +156,9 @@ int create_output_dev(const char* uinput_path, const char* name, output_dev_type
ioctl(fd, UI_SET_KEYBIT, BTN_NORTH);
ioctl(fd, UI_SET_KEYBIT, BTN_WEST);
ioctl(fd, UI_SET_KEYBIT, BTN_TL);
ioctl(fd, UI_SET_KEYBIT, BTN_TL2);
ioctl(fd, UI_SET_KEYBIT, BTN_TR);
ioctl(fd, UI_SET_KEYBIT, BTN_TR2);
ioctl(fd, UI_SET_KEYBIT, BTN_SELECT);
ioctl(fd, UI_SET_KEYBIT, BTN_START);
ioctl(fd, UI_SET_KEYBIT, BTN_MODE);
@ -359,6 +361,12 @@ void *output_dev_thread_func(void *ptr) {
if ((ev.type == EV_KEY) && (ev.code == KEY_F16)) {
ev.code = BTN_MODE;
} else if ((ev.type == EV_KEY) && (ev.code == KEY_PROG1)) { // To be wired to F16
ev.code = BTN_TR2;
} else if ((ev.type == EV_KEY) && (ev.code == KEY_F18)) { // To be wired to F16
ev.code = BTN_TR2;
} else if ((ev.type == EV_KEY) && (ev.code == KEY_F17)) { // To be wired to F16
ev.code = BTN_TL2;
}
const ssize_t written = write(fd, (void*)&ev, sizeof(ev));