[PATCH] Handle scancode extensions E1 and E2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Do not handle them as normal keys.
State is not saved for these keys.

Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
---
 server/inputs-channel.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/server/inputs-channel.c b/server/inputs-channel.c
index 8f0a206..69d0391 100644
--- a/server/inputs-channel.c
+++ b/server/inputs-channel.c
@@ -57,7 +57,7 @@
     (4096 + (REDS_AGENT_WINDOW_SIZE + REDS_NUM_INTERNAL_AGENT_MESSAGES) * SPICE_AGENT_MAX_DATA_SIZE)
 
 struct SpiceKbdState {
-    bool push_ext;
+    uint8_t push_ext_type;
 
     /* track key press state */
     bool key[0x80];
@@ -200,12 +200,14 @@ static void kbd_push_scan(SpiceKbdInstance *sin, uint8_t scan)
     sif = SPICE_CONTAINEROF(sin->base.sif, SpiceKbdInterface, base);
 
     /* track XT scan code set 1 key state */
-    if (scan == 0xe0) {
-        sin->st->push_ext = TRUE;
+    if (scan >= 0xe0 && scan <= 0xe2) {
+        sin->st->push_ext_type = scan;
     } else {
-        bool *state = sin->st->push_ext ? sin->st->key : sin->st->key_ext;
-        sin->st->push_ext = FALSE;
-        state[scan & 0x7f] = !(scan & 0x80);
+        if (sin->st->push_ext_type == 0 || sin->st->push_ext_type == 0xe0) {
+            bool *state = sin->st->push_ext_type ? sin->st->key_ext : sin->st->key;
+            state[scan & 0x7f] = !(scan & 0x80);
+        }
+        sin->st->push_ext_type = 0;
     }
 
     sif->push_scan_freg(sin, scan);
-- 
2.7.4

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]