From 89dd90c91b9978ef9b176e4b5f32dc6084bd4163 Mon Sep 17 00:00:00 2001 From: Denis Date: Sun, 12 Nov 2023 19:55:09 +0100 Subject: [PATCH] Cannot make it work :( --- input_dev.c | 4 ---- input_dev.h | 2 +- output_dev.c | 6 ++++++ output_dev.h | 2 ++ 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/input_dev.c b/input_dev.c index bb907f8..4dff9e1 100644 --- a/input_dev.c +++ b/input_dev.c @@ -88,22 +88,18 @@ int input_filter_asus_kb(struct input_event* events, size_t* size, uint32_t* cou events[1].type = SYN_REPORT; events[1].code = EV_SYN; events[1].value = 0; - events[1].time = events[0].time; events[2].type = EV_KEY; events[2].code = BTN_SOUTH; events[2].value = 1; - events[2].time = time; events[3].type = SYN_REPORT; events[3].code = EV_SYN; events[3].value = 0; - events[3].time = time; events[4].type = EV_KEY; events[4].code = BTN_SOUTH; events[4].value = 0; - events[4].time = time; return INPUT_FILTER_RESULT_OK; } diff --git a/input_dev.h b/input_dev.h index 5590e4e..c298e9c 100644 --- a/input_dev.h +++ b/input_dev.h @@ -3,7 +3,7 @@ #include "queue.h" #include "message.h" -#define INCLUDE_INPUT_DEBUG +#undef INCLUDE_INPUT_DEBUG #undef IGNORE_INPUT_SCAN #define INPUT_DEV_CTRL_FLAG_EXIT 0x00000001U diff --git a/output_dev.c b/output_dev.c index e6f130e..884c174 100644 --- a/output_dev.c +++ b/output_dev.c @@ -24,6 +24,12 @@ int create_output_dev(const char* uinput_path, const char* name, output_dev_type dev.id.product = OUTPUT_DEV_PRODUCT_ID; dev.id.version = OUTPUT_DEV_VERSION; +#if defined(UI_SET_PHYS_STR) + ioctl(fd, UI_SET_PHYS_STR, PHYS_STR); +#else + #warning Controller and gyroscope won't be recognized as a single device +#endif + switch (type) { case output_dev_imu: { ioctl(fd, UI_SET_PROPBIT, INPUT_PROP_ACCELEROMETER); diff --git a/output_dev.h b/output_dev.h index faee018..5863d13 100644 --- a/output_dev.h +++ b/output_dev.h @@ -30,6 +30,8 @@ #define OUTPUT_DEV_PRODUCT_ID 0x0ce6 */ +#define PHYS_STR "00:11:22:33:44:55" + #define OUTPUT_DEV_CTRL_FLAG_EXIT 0x00000001U #define OUTPUT_DEV_CTRL_FLAG_DATA 0x00000002U