summary refs log tree commit diff stats
path: root/ui/spice-input.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2017-07-27 15:27:06 +0100
committerPeter Maydell <peter.maydell@linaro.org>2017-07-27 15:27:06 +0100
commite01151de165070c25a1b202e9e2392950bd7c8da (patch)
treeed0caa6f429d5b388e9c9bacf23fd84b928291e5 /ui/spice-input.c
parent6be37cc583454ee27587a79b6008e22c3cc1a763 (diff)
parent7c388dbd0b2c54b3d836c23ea43e2cee38de66a4 (diff)
downloadfocaccia-qemu-e01151de165070c25a1b202e9e2392950bd7c8da.tar.gz
focaccia-qemu-e01151de165070c25a1b202e9e2392950bd7c8da.zip
Merge remote-tracking branch 'remotes/kraxel/tags/ui-20170727-pull-request' into staging
ui: keymap fixes for 2.10

# gpg: Signature made Thu 27 Jul 2017 15:00:06 BST
# gpg:                using RSA key 0x4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/ui-20170727-pull-request:
  ps2: fix sending of PAUSE/BREAK scancodes
  ui: drop altgr and altgr_r QKeyCodes
  ps2: enable multimedia keys
  ui: add multimedia keys
  ui: update keymaps
  ui: move qemu_input_linux_to_qcode()
  ui: add next and prior keysyms

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'ui/spice-input.c')
-rw-r--r--ui/spice-input.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/ui/spice-input.c b/ui/spice-input.c
index 918580239d..cda9976469 100644
--- a/ui/spice-input.c
+++ b/ui/spice-input.c
@@ -32,6 +32,7 @@ typedef struct QemuSpiceKbd {
     SpiceKbdInstance sin;
     int ledstate;
     bool emul0;
+    size_t pauseseq;
 } QemuSpiceKbd;
 
 static void kbd_push_key(SpiceKbdInstance *sin, uint8_t frag);
@@ -64,6 +65,25 @@ static void kbd_push_key(SpiceKbdInstance *sin, uint8_t scancode)
         keycode |= SCANCODE_GREY;
     }
 
+    if (scancode == SCANCODE_EMUL1) {
+        kbd->pauseseq++;
+        return;
+    } else if (kbd->pauseseq == 1) {
+        if (keycode == 0x1d) {
+            kbd->pauseseq++;
+            return;
+        } else {
+            kbd->pauseseq = 0;
+        }
+    } else if (kbd->pauseseq == 2) {
+        if (keycode == 0x45) {
+            qemu_input_event_send_key_qcode(NULL, Q_KEY_CODE_PAUSE, !up);
+            kbd->pauseseq = 0;
+            return;
+        }
+        kbd->pauseseq = 0;
+    }
+
     qemu_input_event_send_key_number(NULL, keycode, !up);
 }