]>
Commit | Line | Data |
---|---|---|
4676c0af DM |
1 | Index: new/ui/vnc.c |
2 | =================================================================== | |
823c12e3 DM |
3 | --- new.orig/ui/vnc.c 2013-11-26 10:50:23.000000000 +0100 |
4 | +++ new/ui/vnc.c 2013-11-26 11:12:22.000000000 +0100 | |
5 | @@ -1625,6 +1625,10 @@ | |
4676c0af DM |
6 | |
7 | static void do_key_event(VncState *vs, int down, int keycode, int sym) | |
8 | { | |
9 | + int mods = keycode & 0xf00; | |
10 | + | |
11 | + keycode &= SCANCODE_KEYMASK; | |
12 | + | |
13 | /* QEMU console switch */ | |
14 | switch(keycode) { | |
15 | case 0x2a: /* Left Shift */ | |
823c12e3 | 16 | @@ -1700,12 +1704,42 @@ |
4676c0af DM |
17 | } |
18 | ||
823c12e3 | 19 | if (qemu_console_is_graphic(NULL)) { |
4676c0af DM |
20 | + |
21 | + /* our java vnc client never sends ALTGR, so we create | |
22 | + an artificial up/down event */ | |
23 | + | |
24 | + int emul_altgr = (mods & SCANCODE_ALTGR) && | |
25 | + !vs->modifiers_state[0xb8]; | |
26 | + | |
27 | + if (emul_altgr) { | |
823c12e3 DM |
28 | + reset_keys(vs); |
29 | + kbd_put_keycode(SCANCODE_EMUL0); | |
30 | + kbd_put_keycode(0xb8 & SCANCODE_KEYCODEMASK); | |
4676c0af DM |
31 | + } |
32 | + | |
33 | + int emul_shift = (mods & SCANCODE_SHIFT) && | |
34 | + !vs->modifiers_state[0x2a]; | |
35 | + | |
36 | + if (emul_shift) { | |
37 | + kbd_put_keycode(0x2a & SCANCODE_KEYCODEMASK); | |
38 | + } | |
39 | + | |
40 | if (keycode & SCANCODE_GREY) | |
41 | kbd_put_keycode(SCANCODE_EMUL0); | |
42 | if (down) | |
43 | kbd_put_keycode(keycode & SCANCODE_KEYCODEMASK); | |
44 | else | |
45 | kbd_put_keycode(keycode | SCANCODE_UP); | |
46 | + | |
823c12e3 DM |
47 | + if (emul_shift) { |
48 | + kbd_put_keycode(0x2a | SCANCODE_UP); | |
49 | + } | |
4676c0af DM |
50 | + |
51 | + if (emul_altgr) { | |
52 | + kbd_put_keycode(SCANCODE_EMUL0); | |
53 | + kbd_put_keycode(0xb8 | SCANCODE_UP); | |
54 | + } | |
55 | + | |
56 | } else { | |
b4818867 DM |
57 | bool numlock = vs->modifiers_state[0x45]; |
58 | bool control = (vs->modifiers_state[0x1d] || | |
823c12e3 | 59 | @@ -1842,7 +1876,8 @@ |
4676c0af DM |
60 | lsym = lsym - 'A' + 'a'; |
61 | } | |
62 | ||
63 | - keycode = keysym2scancode(vs->vd->kbd_layout, lsym & 0xFFFF) & SCANCODE_KEYMASK; | |
64 | + keycode = keysym2scancode(vs->vd->kbd_layout, lsym & 0xFFFF); | |
65 | + | |
66 | do_key_event(vs, down, keycode, sym); | |
67 | } | |
68 | ||
823c12e3 DM |
69 | @@ -3032,7 +3067,7 @@ |
70 | char *vnc_display_local_addr(DisplayState *ds) | |
71 | { | |
72 | VncDisplay *vs = vnc_display; | |
73 | - | |
74 | + | |
75 | return vnc_socket_local_addr("%s:%s", vs->lsock); | |
76 | } | |
77 |