Commit b71e95fc2c030428c768de20332f9d857b9aed41

Authored by bellard
1 parent 04a3b84c

win32 patch (kazu)


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@829 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 9 additions and 13 deletions
@@ -87,20 +87,20 @@ static const uint32_t x_keycode_to_pc_keycode[61] = { @@ -87,20 +87,20 @@ static const uint32_t x_keycode_to_pc_keycode[61] = {
87 0x0, /* 117 */ 87 0x0, /* 117 */
88 0x0, /* 118 */ 88 0x0, /* 118 */
89 0x0, /* 119 */ 89 0x0, /* 119 */
90 - 0x0, /* 120 */ 90 + 0x70, /* 120 Hiragana_Katakana */
91 0x0, /* 121 */ 91 0x0, /* 121 */
92 0x0, /* 122 */ 92 0x0, /* 122 */
93 - 0x0, /* 123 */ 93 + 0x73, /* 123 backslash */
94 0x0, /* 124 */ 94 0x0, /* 124 */
95 0x0, /* 125 */ 95 0x0, /* 125 */
96 0x0, /* 126 */ 96 0x0, /* 126 */
97 0x0, /* 127 */ 97 0x0, /* 127 */
98 0x0, /* 128 */ 98 0x0, /* 128 */
99 - 0x0, /* 129 */ 99 + 0x79, /* 129 Henkan */
100 0x0, /* 130 */ 100 0x0, /* 130 */
101 - 0x0, /* 131 */ 101 + 0x7b, /* 131 Muhenkan */
102 0x0, /* 132 */ 102 0x0, /* 132 */
103 - 0x0, /* 133 */ 103 + 0x7d, /* 133 Yen */
104 0x0, /* 134 */ 104 0x0, /* 134 */
105 0x0, /* 135 */ 105 0x0, /* 135 */
106 0x47, /* 136 KP_7 */ 106 0x47, /* 136 KP_7 */
@@ -133,23 +133,19 @@ static void sdl_process_key(SDL_KeyboardEvent *ev) @@ -133,23 +133,19 @@ static void sdl_process_key(SDL_KeyboardEvent *ev)
133 133
134 /* XXX: not portable, but avoids complicated mappings */ 134 /* XXX: not portable, but avoids complicated mappings */
135 keycode = ev->keysym.scancode; 135 keycode = ev->keysym.scancode;
136 -#ifdef _WIN32  
137 - if (keycode < 97) {  
138 - /* nothing to do */  
139 - } else  
140 -#else 136 +
  137 +#ifndef _WIN32
141 if (keycode < 9) { 138 if (keycode < 9) {
142 keycode = 0; 139 keycode = 0;
143 } else if (keycode < 97) { 140 } else if (keycode < 97) {
144 keycode -= 8; /* just an offset */ 141 keycode -= 8; /* just an offset */
145 - } else  
146 -#endif  
147 - if (keycode < 158) { 142 + } else if (keycode < 158) {
148 /* use conversion table */ 143 /* use conversion table */
149 keycode = x_keycode_to_pc_keycode[keycode - 97]; 144 keycode = x_keycode_to_pc_keycode[keycode - 97];
150 } else { 145 } else {
151 keycode = 0; 146 keycode = 0;
152 } 147 }
  148 +#endif
153 149
154 /* now send the key code */ 150 /* now send the key code */
155 while (keycode != 0) { 151 while (keycode != 0) {