source: trunk/packages/xen-common/xen-common/tools/ioemu/patches/vnc-monitor-shift-key-processing @ 34

Last change on this file since 34 was 34, checked in by hartmans, 17 years ago

Add xen and xen-common

File size: 1.5 KB
Line 
1# HG changeset patch
2# User kfraser@localhost.localdomain
3# Node ID 582d21e2d3cd12a13ad4debee9af8bb0f1be413a
4# Parent  b7095209e31ae1f52cd4b196225a360543e37a80
5[QEMU] Do shift-key processing in QEMU monitor terminal when connected via VNC.
6Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
7
8Index: ioemu/vnc.c
9===================================================================
10--- ioemu.orig/vnc.c    2006-12-08 18:21:36.000000000 +0000
11+++ ioemu/vnc.c 2006-12-08 18:23:12.000000000 +0000
12@@ -114,6 +114,7 @@
13     int visible_h;
14 
15     int ctl_keys;               /* Ctrl+Alt starts calibration */
16+    int shift_keys;             /* Shift / CapsLock keys */
17 };
18 
19 #define DIRTY_PIXEL_BITS 64
20@@ -870,9 +871,12 @@
21     } else if (down) {
22        int qemu_keysym = 0;
23 
24-       if (sym <= 128) /* normal ascii */
25+       if (sym <= 128) { /* normal ascii */
26+           int shifted = vs->shift_keys == 1 || vs->shift_keys == 2;
27            qemu_keysym = sym;
28-       else {
29+           if (sym >= 'a' && sym <= 'z' && shifted)
30+               qemu_keysym -= 'a' - 'A';
31+       } else {
32            switch (sym) {
33            case XK_Up: qemu_keysym = QEMU_KEY_UP; break;
34            case XK_Down: qemu_keysym = QEMU_KEY_DOWN; break;
35@@ -903,6 +907,10 @@
36            vs->ctl_keys |= 2;
37            break;
38 
39+       case XK_Shift_L:
40+           vs->shift_keys |= 1;
41+           break;
42+
43        default:
44            break;
45        }
46@@ -916,6 +924,14 @@
47            vs->ctl_keys &= ~2;
48            break;
49 
50+       case XK_Shift_L:
51+           vs->shift_keys &= ~1;
52+           break;
53+
54+       case XK_Caps_Lock:
55+           vs->shift_keys ^= 2;
56+           break;
57+
58        case XK_1 ... XK_9:
59            if ((vs->ctl_keys & 3) != 3)
60                break;
Note: See TracBrowser for help on using the repository browser.