Patchwork [1/2] vnc: Add SCROLL lock key to kbd_leds

login
register
mail settings
Submitter Lei Li
Date April 15, 2013, 9:29 a.m.
Message ID <1366018149-16508-2-git-send-email-lilei@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/236544/
State New
Headers show

Comments

Lei Li - April 15, 2013, 9:29 a.m.
Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com>
---
 ui/vnc.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

Patch

diff --git a/ui/vnc.c b/ui/vnc.c
index 5ddb696..fa7ab94 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -1532,10 +1532,11 @@  static void press_key(VncState *vs, int keysym)
 static void kbd_leds(void *opaque, int ledstate)
 {
     VncState *vs = opaque;
-    int caps, num;
+    int caps, num, scr;
 
     caps = ledstate & QEMU_CAPS_LOCK_LED ? 1 : 0;
     num  = ledstate & QEMU_NUM_LOCK_LED  ? 1 : 0;
+    scr  = ledstate & QEMU_SCROLL_LOCK_LED ? 1 : 0;
 
     if (vs->modifiers_state[0x3a] != caps) {
         vs->modifiers_state[0x3a] = caps;
@@ -1543,6 +1544,9 @@  static void kbd_leds(void *opaque, int ledstate)
     if (vs->modifiers_state[0x45] != num) {
         vs->modifiers_state[0x45] = num;
     }
+    if (vs->modifiers_state[0x46] != scr) {
+        vs->modifiers_state[0x46] = scr;
+    }
 }
 
 static void do_key_event(VncState *vs, int down, int keycode, int sym)