Commit 60659e3b4488a6947a4ee2835f669b5d5463e34e

Authored by bellard
1 parent f0e42172

Japanese keyboard fixes (kazu)


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2129 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 2 changed files with 27 additions and 4 deletions
keymaps/ja
... ... @@ -97,6 +97,7 @@ Eisu_toggle 0x3a shift
97 97 Execute 0x54 shift
98 98 Kanji 0x70
99 99 backslash 0x73
  100 +yen 0x7d
100 101 bar 0x7d shift
101 102 underscore 0x73 shift
102 103 Henkan_Mode 0x79
... ...
... ... @@ -104,6 +104,10 @@ static uint8_t sdl_keyevent_to_keycode_generic(const SDL_KeyboardEvent *ev)
104 104 keysym = ev->keysym.sym;
105 105 if (keysym == 0 && ev->keysym.scancode == 113)
106 106 keysym = SDLK_MODE;
  107 + /* For Japanese key '\' and '|' */
  108 + if (keysym == 92 && ev->keysym.scancode == 133) {
  109 + keysym = 0xa5;
  110 + }
107 111 return keysym2scancode(kbd_layout, keysym);
108 112 }
109 113  
... ... @@ -118,7 +122,7 @@ static uint8_t sdl_keyevent_to_keycode(const SDL_KeyboardEvent *ev)
118 122  
119 123 #else
120 124  
121   -static const uint8_t x_keycode_to_pc_keycode[61] = {
  125 +static const uint8_t x_keycode_to_pc_keycode[115] = {
122 126 0xc7, /* 97 Home */
123 127 0xc8, /* 98 Up */
124 128 0xc9, /* 99 PgUp */
... ... @@ -142,10 +146,10 @@ static const uint8_t x_keycode_to_pc_keycode[61] = {
142 146 0x0, /* 117 */
143 147 0x0, /* 118 */
144 148 0x0, /* 119 */
145   - 0x70, /* 120 Hiragana_Katakana */
  149 + 0x0, /* 120 */
146 150 0x0, /* 121 */
147 151 0x0, /* 122 */
148   - 0x73, /* 123 backslash */
  152 + 0x0, /* 123 */
149 153 0x0, /* 124 */
150 154 0x0, /* 125 */
151 155 0x0, /* 126 */
... ... @@ -180,6 +184,24 @@ static const uint8_t x_keycode_to_pc_keycode[61] = {
180 184 0x51, /* 155 KP_PgDn */
181 185 0x52, /* 156 KP_Ins */
182 186 0x53, /* 157 KP_Del */
  187 + 0x0, /* 158 */
  188 + 0x0, /* 159 */
  189 + 0x0, /* 160 */
  190 + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, /* 170 */
  191 + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, /* 180 */
  192 + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, /* 190 */
  193 + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, /* 200 */
  194 + 0x0, /* 201 */
  195 + 0x0, /* 202 */
  196 + 0x0, /* 203 */
  197 + 0x0, /* 204 */
  198 + 0x0, /* 205 */
  199 + 0x0, /* 206 */
  200 + 0x0, /* 207 */
  201 + 0x70, /* 208 Hiragana_Katakana */
  202 + 0x0, /* 209 */
  203 + 0x0, /* 210 */
  204 + 0x73, /* 211 backslash */
183 205 };
184 206  
185 207 static uint8_t sdl_keyevent_to_keycode(const SDL_KeyboardEvent *ev)
... ... @@ -192,7 +214,7 @@ static uint8_t sdl_keyevent_to_keycode(const SDL_KeyboardEvent *ev)
192 214 keycode = 0;
193 215 } else if (keycode < 97) {
194 216 keycode -= 8; /* just an offset */
195   - } else if (keycode < 158) {
  217 + } else if (keycode < 212) {
196 218 /* use conversion table */
197 219 keycode = x_keycode_to_pc_keycode[keycode - 97];
198 220 } else {
... ...