ia64/xen-unstable

view tools/ioemu/patches/vnc-access-monitor-vt @ 11569:317e8516d464

[qemu patches] Update patches for changeset 11561:c742b2ae920c.

Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
author Christian Limpach <Christian.Limpach@xensource.com>
date Thu Sep 21 19:28:35 2006 +0100 (2006-09-21)
parents a7dcafb540be
children 043f8799e68e
line source
1 Index: ioemu/vnc.c
2 ===================================================================
3 --- ioemu.orig/vnc.c 2006-09-21 19:10:57.000000000 +0100
4 +++ ioemu/vnc.c 2006-09-21 19:11:00.000000000 +0100
5 @@ -32,6 +32,10 @@
6 #include "vnc_keysym.h"
7 #include "keymaps.c"
9 +#define XK_MISCELLANY
10 +#define XK_LATIN1
11 +#include <X11/keysymdef.h>
12 +
13 typedef struct Buffer
14 {
15 size_t capacity;
16 @@ -95,6 +99,8 @@
17 int visible_h;
19 int slow_client;
20 +
21 + int ctl_keys; /* Ctrl+Alt starts calibration */
22 };
24 #define DIRTY_PIXEL_BITS 64
25 @@ -790,16 +796,80 @@
27 static void do_key_event(VncState *vs, int down, uint32_t sym)
28 {
29 - int keycode;
30 + sym &= 0xFFFF;
32 - keycode = keysym2scancode(vs->kbd_layout, sym & 0xFFFF);
33 + if (is_graphic_console()) {
34 + int keycode;
36 - if (keycode & 0x80)
37 - kbd_put_keycode(0xe0);
38 - if (down)
39 - kbd_put_keycode(keycode & 0x7f);
40 - else
41 - kbd_put_keycode(keycode | 0x80);
42 + keycode = keysym2scancode(vs->kbd_layout, sym);
43 + if (keycode & 0x80)
44 + kbd_put_keycode(0xe0);
45 + if (down)
46 + kbd_put_keycode(keycode & 0x7f);
47 + else
48 + kbd_put_keycode(keycode | 0x80);
49 + } else if (down) {
50 + int qemu_keysym = 0;
51 +
52 + if (sym <= 128) /* normal ascii */
53 + qemu_keysym = sym;
54 + else {
55 + switch (sym) {
56 + case XK_Up: qemu_keysym = QEMU_KEY_UP; break;
57 + case XK_Down: qemu_keysym = QEMU_KEY_DOWN; break;
58 + case XK_Left: qemu_keysym = QEMU_KEY_LEFT; break;
59 + case XK_Right: qemu_keysym = QEMU_KEY_RIGHT; break;
60 + case XK_Home: qemu_keysym = QEMU_KEY_HOME; break;
61 + case XK_End: qemu_keysym = QEMU_KEY_END; break;
62 + case XK_Page_Up: qemu_keysym = QEMU_KEY_PAGEUP; break;
63 + case XK_Page_Down: qemu_keysym = QEMU_KEY_PAGEDOWN; break;
64 + case XK_BackSpace: qemu_keysym = QEMU_KEY_BACKSPACE; break;
65 + case XK_Delete: qemu_keysym = QEMU_KEY_DELETE; break;
66 + case XK_Return:
67 + case XK_Linefeed: qemu_keysym = sym; break;
68 + default: break;
69 + }
70 + }
71 + if (qemu_keysym != 0)
72 + kbd_put_keysym(qemu_keysym);
73 + }
74 +
75 + if (down) {
76 + switch (sym) {
77 + case XK_Control_L:
78 + vs->ctl_keys |= 1;
79 + break;
80 +
81 + case XK_Alt_L:
82 + vs->ctl_keys |= 2;
83 + break;
84 +
85 + default:
86 + break;
87 + }
88 + } else {
89 + switch (sym) {
90 + case XK_Control_L:
91 + vs->ctl_keys &= ~1;
92 + break;
93 +
94 + case XK_Alt_L:
95 + vs->ctl_keys &= ~2;
96 + break;
97 +
98 + case XK_1 ... XK_9:
99 + if ((vs->ctl_keys & 3) != 3)
100 + break;
101 +
102 + console_select(sym - XK_1);
103 + if (is_graphic_console()) {
104 + /* tell the vga console to redisplay itself */
105 + vga_hw_invalidate();
106 + vnc_dpy_update(vs->ds, 0, 0, vs->ds->width, vs->ds->height);
107 + }
108 + break;
109 + }
110 + }
111 }
113 static void key_event(VncState *vs, int down, uint32_t sym)