-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0001-cringe-input-patch.patch
67 lines (59 loc) · 2.09 KB
/
0001-cringe-input-patch.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
From 5aa1f5ac8507e4bfaf1d76d873a75976251feb06 Mon Sep 17 00:00:00 2001
From: Babbaj <[email protected]>
Date: Thu, 20 May 2021 19:30:30 -0400
Subject: [PATCH] cringe input patch
---
ui/input-linux.c | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
diff --git a/ui/input-linux.c b/ui/input-linux.c
index 4925ce1af1..f8f29a5281 100644
--- a/ui/input-linux.c
+++ b/ui/input-linux.c
@@ -82,9 +82,14 @@ static void input_linux_toggle_grab(InputLinux *il)
InputLinux *item;
int rc;
- rc = ioctl(il->fd, EVIOCGRAB, request);
- if (rc < 0) {
- return;
+ const bool isMouseKbd = strstr(il->evdev, "usb-Logitech_G203_LIGHTSYNC_Gaming_Mouse_206B37804B42-if01-event-kbd");
+ if (isMouseKbd) {
+ rc = 0;
+ } else {
+ rc = ioctl(il->fd, EVIOCGRAB, request);
+ if (rc < 0) {
+ return;
+ }
}
il->grab_active = !il->grab_active;
@@ -104,6 +109,9 @@ static void input_linux_toggle_grab(InputLinux *il)
static bool input_linux_check_toggle(InputLinux *il)
{
+ if (il->keydown[KEY_COMPOSE]) {
+ return true;
+ }
switch (il->grab_toggle) {
case GRAB_TOGGLE_KEYS_CTRL_CTRL:
return il->keydown[KEY_LEFTCTRL] &&
@@ -174,7 +182,7 @@ static void input_linux_handle_keyboard(InputLinux *il,
}
/* send event to guest when grab is active */
- if (il->grab_active && !input_linux_should_skip(il, event)) {
+ if (il->grab_active && !input_linux_should_skip(il, event) && event->code != KEY_COMPOSE) {
int qcode = qemu_input_linux_to_qcode(event->code);
qemu_input_event_send_key_qcode(NULL, qcode, event->value);
}
@@ -402,12 +410,7 @@ static void input_linux_complete(UserCreatable *uc, Error **errp)
}
qemu_set_fd_handler(il->fd, input_linux_event, NULL, il);
- if (il->keycount) {
- /* delay grab until all keys are released */
- il->grab_request = true;
- } else {
- input_linux_toggle_grab(il);
- }
+
QTAILQ_INSERT_TAIL(&inputs, il, next);
il->initialized = true;
return;
--
2.29.3