Commit 60659e3b4488a6947a4ee2835f669b5d5463e34e
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,6 +97,7 @@ Eisu_toggle 0x3a shift | ||
| 97 | Execute 0x54 shift | 97 | Execute 0x54 shift |
| 98 | Kanji 0x70 | 98 | Kanji 0x70 |
| 99 | backslash 0x73 | 99 | backslash 0x73 |
| 100 | +yen 0x7d | ||
| 100 | bar 0x7d shift | 101 | bar 0x7d shift |
| 101 | underscore 0x73 shift | 102 | underscore 0x73 shift |
| 102 | Henkan_Mode 0x79 | 103 | Henkan_Mode 0x79 |
sdl.c
| @@ -104,6 +104,10 @@ static uint8_t sdl_keyevent_to_keycode_generic(const SDL_KeyboardEvent *ev) | @@ -104,6 +104,10 @@ static uint8_t sdl_keyevent_to_keycode_generic(const SDL_KeyboardEvent *ev) | ||
| 104 | keysym = ev->keysym.sym; | 104 | keysym = ev->keysym.sym; |
| 105 | if (keysym == 0 && ev->keysym.scancode == 113) | 105 | if (keysym == 0 && ev->keysym.scancode == 113) |
| 106 | keysym = SDLK_MODE; | 106 | keysym = SDLK_MODE; |
| 107 | + /* For Japanese key '\' and '|' */ | ||
| 108 | + if (keysym == 92 && ev->keysym.scancode == 133) { | ||
| 109 | + keysym = 0xa5; | ||
| 110 | + } | ||
| 107 | return keysym2scancode(kbd_layout, keysym); | 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,7 +122,7 @@ static uint8_t sdl_keyevent_to_keycode(const SDL_KeyboardEvent *ev) | ||
| 118 | 122 | ||
| 119 | #else | 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 | 0xc7, /* 97 Home */ | 126 | 0xc7, /* 97 Home */ |
| 123 | 0xc8, /* 98 Up */ | 127 | 0xc8, /* 98 Up */ |
| 124 | 0xc9, /* 99 PgUp */ | 128 | 0xc9, /* 99 PgUp */ |
| @@ -142,10 +146,10 @@ static const uint8_t x_keycode_to_pc_keycode[61] = { | @@ -142,10 +146,10 @@ static const uint8_t x_keycode_to_pc_keycode[61] = { | ||
| 142 | 0x0, /* 117 */ | 146 | 0x0, /* 117 */ |
| 143 | 0x0, /* 118 */ | 147 | 0x0, /* 118 */ |
| 144 | 0x0, /* 119 */ | 148 | 0x0, /* 119 */ |
| 145 | - 0x70, /* 120 Hiragana_Katakana */ | 149 | + 0x0, /* 120 */ |
| 146 | 0x0, /* 121 */ | 150 | 0x0, /* 121 */ |
| 147 | 0x0, /* 122 */ | 151 | 0x0, /* 122 */ |
| 148 | - 0x73, /* 123 backslash */ | 152 | + 0x0, /* 123 */ |
| 149 | 0x0, /* 124 */ | 153 | 0x0, /* 124 */ |
| 150 | 0x0, /* 125 */ | 154 | 0x0, /* 125 */ |
| 151 | 0x0, /* 126 */ | 155 | 0x0, /* 126 */ |
| @@ -180,6 +184,24 @@ static const uint8_t x_keycode_to_pc_keycode[61] = { | @@ -180,6 +184,24 @@ static const uint8_t x_keycode_to_pc_keycode[61] = { | ||
| 180 | 0x51, /* 155 KP_PgDn */ | 184 | 0x51, /* 155 KP_PgDn */ |
| 181 | 0x52, /* 156 KP_Ins */ | 185 | 0x52, /* 156 KP_Ins */ |
| 182 | 0x53, /* 157 KP_Del */ | 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 | static uint8_t sdl_keyevent_to_keycode(const SDL_KeyboardEvent *ev) | 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,7 +214,7 @@ static uint8_t sdl_keyevent_to_keycode(const SDL_KeyboardEvent *ev) | ||
| 192 | keycode = 0; | 214 | keycode = 0; |
| 193 | } else if (keycode < 97) { | 215 | } else if (keycode < 97) { |
| 194 | keycode -= 8; /* just an offset */ | 216 | keycode -= 8; /* just an offset */ |
| 195 | - } else if (keycode < 158) { | 217 | + } else if (keycode < 212) { |
| 196 | /* use conversion table */ | 218 | /* use conversion table */ |
| 197 | keycode = x_keycode_to_pc_keycode[keycode - 97]; | 219 | keycode = x_keycode_to_pc_keycode[keycode - 97]; |
| 198 | } else { | 220 | } else { |