From 63440a456eee1c280e99ac3c76d423765ba06359 Mon Sep 17 00:00:00 2001 From: htrefil <8711792+htrefil@users.noreply.github.com> Date: Sun, 25 Oct 2020 18:25:41 +0100 Subject: [PATCH] Fix setup --- input/setup/setup.c | 67 +-------------------------------------------- 1 file changed, 1 insertion(+), 66 deletions(-) diff --git a/input/setup/setup.c b/input/setup/setup.c index 6f0c21b..e5fdfd0 100644 --- a/input/setup/setup.c +++ b/input/setup/setup.c @@ -1,69 +1,3 @@ -// #include -// #include -// #include - -// #include "setup.h" - -// #define IOCTL(fd, ...) if (ioctl(fd, __VA_ARGS__) == -1) return 0; - -// int setup_write_fd(int fd) { -// for (int i = 0; i < EV_MAX; i++) { -// if (i == EV_FF || i == EV_LED) -// continue; - -// IOCTL(fd, UI_SET_EVBIT, i); -// } - -// for (int i = 0; i < KEY_MAX; i++) -// IOCTL(fd, UI_SET_KEYBIT, i); - -// for (int i = 0; i < ABS_MAX; i++) -// IOCTL(fd, UI_SET_ABSBIT, i); - -// for (int i = 0; i < REL_MAX; i++) -// IOCTL(fd, UI_SET_RELBIT, i); - -// // IOCTL(fd, UI_SET_EVBIT, EV_KEY); -// // IOCTL(fd, UI_SET_EVBIT, EV_SYN); -// // IOCTL(fd, UI_SET_EVBIT, EV_REL); - -// // for (int i = 0; i < KEY_MAX; i++) -// // IOCTL(fd, UI_SET_KEYBIT, i); - -// // for (int i = 0; i < ABS_MAX; i++) -// // IOCTL(fd, UI_SET_ABSBIT, i); - -// // IOCTL(fd, UI_SET_KEYBIT, BTN_LEFT); -// // IOCTL(fd, UI_SET_KEYBIT, BTN_RIGHT); - -// // IOCTL(fd, UI_SET_RELBIT, REL_X); -// // IOCTL(fd, UI_SET_RELBIT, REL_Y); -// // IOCTL(fd, UI_SET_RELBIT, REL_WHEEL); - -// struct uinput_setup setup; -// memset(&setup, 0, sizeof(setup)); -// setup.id.bustype = BUS_USB; -// setup.id.vendor = 1; -// setup.id.product = 1; -// setup.ff_effects_max = 0; -// strcpy(setup.name, "rkvm"); - -// IOCTL(fd, UI_DEV_SETUP, &setup); -// IOCTL(fd, UI_DEV_CREATE); - -// return 1; -// } - -// int destroy_write_fd(int fd) { -// IOCTL(fd, UI_DEV_DESTROY); -// return 1; -// } - -// int setup_read_fd(int fd) { -// IOCTL(fd, EVIOCGRAB, 1); -// return 1; -// } - #include #include @@ -75,6 +9,7 @@ int setup_write_fd(int fd) { IOCTL(fd, UI_SET_EVBIT, EV_KEY); IOCTL(fd, UI_SET_EVBIT, EV_SYN); IOCTL(fd, UI_SET_EVBIT, EV_REL); + IOCTL(fd, UI_SET_EVBIT, EV_ABS); for (int i = 0; i < KEY_MAX; i++) IOCTL(fd, UI_SET_KEYBIT, i);