[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 11/97] kbd-state: fix autorepeat handling
From: |
Michael Roth |
Subject: |
[PATCH 11/97] kbd-state: fix autorepeat handling |
Date: |
Tue, 1 Oct 2019 18:44:50 -0500 |
From: Gerd Hoffmann <address@hidden>
When allowing multiple down-events in a row (key autorepeat) we can't
use change_bit() any more to update the state, because autorepeat events
don't change the key state. We have to explicitly use set_bit() and
clear_bit() instead.
Cc: address@hidden
Fixes: 35921860156e kbd-state: don't block auto-repeat events
Buglink: https://bugs.launchpad.net/qemu/+bug/1828272
Signed-off-by: Gerd Hoffmann <address@hidden>
Message-id: address@hidden
(cherry picked from commit 5fff13f245cddd3bc260dfe6ebe1b1f05b72116f)
Signed-off-by: Michael Roth <address@hidden>
---
ui/kbd-state.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/ui/kbd-state.c b/ui/kbd-state.c
index f3ab2d7a66..1668d17dda 100644
--- a/ui/kbd-state.c
+++ b/ui/kbd-state.c
@@ -59,7 +59,11 @@ void qkbd_state_key_event(QKbdState *kbd, QKeyCode qcode,
bool down)
}
/* update key and modifier state */
- change_bit(qcode, kbd->keys);
+ if (down) {
+ set_bit(qcode, kbd->keys);
+ } else {
+ clear_bit(qcode, kbd->keys);
+ }
switch (qcode) {
case Q_KEY_CODE_SHIFT:
case Q_KEY_CODE_SHIFT_R:
--
2.17.1
- [PATCH 00/97] Patch Round-up for stable 4.0.1, freeze on 2019-10-10, Michael Roth, 2019/10/01
- [PATCH 12/97] usb-tablet: fix serial compat property, Michael Roth, 2019/10/01
- [PATCH 22/97] iotests.py: rewrite run_job to be pickier, Michael Roth, 2019/10/01
- [PATCH 21/97] iotests.py: Fix VM.run_job, Michael Roth, 2019/10/01
- [PATCH 16/97] blockdev-backup: don't check aio_context too early, Michael Roth, 2019/10/01
- [PATCH 11/97] kbd-state: fix autorepeat handling,
Michael Roth <=
- [PATCH 15/97] s390x/cpumodel: ignore csske for expansion, Michael Roth, 2019/10/01
- [PATCH 24/97] migration/dirty-bitmaps: change bitmap enumeration method, Michael Roth, 2019/10/01
- [PATCH 18/97] iotests: Test commit job start with concurrent I/O, Michael Roth, 2019/10/01
- [PATCH 28/97] target/ppc: Fix xxbrq, xxbrw, Michael Roth, 2019/10/01
- [PATCH 01/97] qcow2: Avoid COW during metadata preallocation, Michael Roth, 2019/10/01
- [PATCH 30/97] target/ppc: Fix lxvw4x, lxvh8x and lxvb16x, Michael Roth, 2019/10/01
- [PATCH 13/97] block/file-posix: Unaligned O_DIRECT block-status, Michael Roth, 2019/10/01
- [PATCH 29/97] target/ppc: Fix vsum2sws, Michael Roth, 2019/10/01
- [PATCH 34/97] target/i386: define md-clear bit, Michael Roth, 2019/10/01
- [PATCH 14/97] iotests: Test unaligned raw images with O_DIRECT, Michael Roth, 2019/10/01