From ccf3ac8d0c95f6edbb967d62862681da1a89bb01 Mon Sep 17 00:00:00 2001 From: Mikhail Burakov Date: Sun, 9 Apr 2023 14:36:09 +0200 Subject: Drop second socket for input handling and use just one --- input.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'input.c') diff --git a/input.c b/input.c index 3644ef0..2ece28b 100644 --- a/input.c +++ b/input.c @@ -251,11 +251,13 @@ bool InputStreamMouseWheel(struct InputStream* input_stream, int delta) { bool InputStreamHandsoff(struct InputStream* input_stream) { memset(input_stream->key_state, 0, sizeof(input_stream->key_state)); - static const struct uhid_event uhid_event_input2 = { - .type = UHID_INPUT2, + memset(&input_stream->button_state, 0, sizeof(input_stream->button_state)); + static const uint8_t uhid_event_input2[] = { + UHID_INPUT2, 0x00, 0x00, 0x00, 0x08, 0x00, 1, 0, 0, 0, 0, 0, 0, 0, + UHID_INPUT2, 0x00, 0x00, 0x00, 0x07, 0x00, 2, 0, 0, 0, 0, 0, 0, }; - bool result = Drain(input_stream->fd, &uhid_event_input2, - sizeof(uhid_event_input2.type)); + bool result = + Drain(input_stream->fd, uhid_event_input2, sizeof(uhid_event_input2)); if (!result) LOG("Failed to drain handsoff"); return result; } -- cgit v1.2.3