summary refs log tree commit diff stats
path: root/ui/kbd-state.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2019-05-17 17:25:19 +0100
committerPeter Maydell <peter.maydell@linaro.org>2019-05-17 17:25:19 +0100
commit1b46b4daa6fbf45eddcf77877379a0afac341df9 (patch)
tree83ca6edb7e62f01c6d82272b970e90a1d9b05354 /ui/kbd-state.c
parent27cb89d1d321e6deb6fc7f80771bb0018af4cd49 (diff)
parent5fff13f245cddd3bc260dfe6ebe1b1f05b72116f (diff)
downloadfocaccia-qemu-1b46b4daa6fbf45eddcf77877379a0afac341df9.tar.gz
focaccia-qemu-1b46b4daa6fbf45eddcf77877379a0afac341df9.zip
Merge remote-tracking branch 'remotes/kraxel/tags/ui-20190517-pull-request' into staging
ui: bugfixes for curses, opengl console and kbd state tracker.

# gpg: Signature made Fri 17 May 2019 17:12:30 BST
# gpg:                using RSA key 4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full]
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>" [full]
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full]
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/ui-20190517-pull-request:
  kbd-state: fix autorepeat handling
  ui/console: Precautionary glBindTexture and surface->texture validation in surface_gl_update_texture
  ui/curses: manipulate cchar_t with standard curses functions
  ui/curses: do not assume wchar_t contains unicode

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'ui/kbd-state.c')
-rw-r--r--ui/kbd-state.c6
1 files changed, 5 insertions, 1 deletions
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: