Skip to content

Commit bdf7d65

Browse files
CLOUDSTACK-7373: Incorrect Japanese keyboard mapping with CentOS CLI and windows guestOS on VMware.
1 parent b53a9dc commit bdf7d65

2 files changed

Lines changed: 18 additions & 16 deletions

File tree

systemvm/js/ajaxkeys.js

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -229,32 +229,32 @@ var keyboardTables = [
229229
{keycode: JS_KEY_ALT, entry : X11_KEY_ALT},
230230
//{keycode: JS_KEY_GRAVE_ACCENT, entry : X11_KEY_GRAVE_ACCENT},
231231
//[192 / 64 = "' @"]
232-
{keycode: 192, entry : 0x5b, browser: "IE"},
233-
{keycode: 64, entry : 0x5b, guestos: "windows", browser: "Firefox"},
232+
{keycode: 192, entry : 0x40, guestos: "windows", browser: "IE"},
233+
{keycode: 64, entry : 0x40, guestos: "windows", browser: "Firefox"},
234234
//{keycode: JS_KEY_ADD, entry : X11_KEY_ADD},
235235
//[187 / 59 = "; +"]
236-
{keycode: 187, entry : 0x3a, browser: "IE"},
236+
{keycode: 187, entry : 0x3b, guestos: "windows", browser: "IE"},
237237
{keycode: 59, entry : 0x3b, guestos: "windows", browser: "Firefox"},
238238
//{keycode: JS_KEY_OPEN_BRACKET, entry : X11_KEY_OPEN_BRACKET},
239239
//[219 = "[{"]
240-
{keycode: 219, entry : 0x5d, guestos: "windows", browser: "IE"},
241-
{keycode: 219, entry : 0x5d, guestos: "windows", browser: "Firefox"},
240+
{keycode: 219, entry : 0x5b, guestos: "windows", browser: "IE"},
241+
{keycode: 219, entry : 0x5b, guestos: "windows", browser: "Firefox"},
242242
//{keycode: JS_KEY_CLOSE_BRACKET, entry : X11_KEY_CLOSE_BRACKET},
243243
//[221 = "]}"]
244-
{keycode: 221, entry : 0x5c, guestos: "windows", browser: "IE"},
245-
{keycode: 221, entry : 0x5c, guestos: "windows", browser: "Firefox"},
244+
{keycode: 221, entry : 0x5d, guestos: "windows", browser: "IE"},
245+
{keycode: 221, entry : 0x5d, guestos: "windows", browser: "Firefox"},
246246
{keycode: JS_KEY_BACK_SLASH, entry : X11_KEY_BACK_SLASH, guestos: "windows"},
247247
//{keycode: JS_KEY_SINGLE_QUOTE, entry : X11_KEY_SINGLE_QUOTE},
248248
//[222 / 160 = "~^"]
249-
{keycode: 222, entry : 0x3d, browser: "IE"},
250-
{keycode: 160, entry : 0x3d, guestos: "windows", browser: "Firefox"},
249+
{keycode: 222, entry : 0x5e, guestos: "windows", browser: "IE"},
250+
{keycode: 160, entry : 0x5e, guestos: "windows", browser: "Firefox"},
251251
//[173 = "-=" ] specific to Firefox browser
252252
{keycode: 173, entry : 0x2d, guestos: "windows", browser: "Firefox"},
253253
{keycode: JS_KEY_COMMA, entry : X11_KEY_COMMA, guestos: "windows"},
254254
{keycode: JS_KEY_PERIOD, entry : X11_KEY_PERIOD, guestos: "windows"},
255255
{keycode: JS_KEY_FORWARD_SLASH, entry : X11_KEY_FORWARD_SLASH, guestos: "windows"},
256-
{keycode: JS_KEY_DASH, entry : X11_KEY_DASH},
257-
{keycode: JS_KEY_SEMI_COLON, entry : X11_KEY_SEMI_COLON},
256+
{keycode: JS_KEY_DASH, entry : X11_KEY_DASH, guestos: "windows"},
257+
{keycode: JS_KEY_SEMI_COLON, entry : 0x3a, guestos: "windows"},
258258
{keycode: JS_KEY_NUMPAD0, entry : X11_KEY_NUMPAD0, guestos: "windows"},
259259
{keycode: JS_KEY_NUMPAD1, entry : X11_KEY_NUMPAD1, guestos: "windows"},
260260
{keycode: JS_KEY_NUMPAD2, entry : X11_KEY_NUMPAD2, guestos: "windows"},
@@ -276,8 +276,10 @@ var keyboardTables = [
276276
//Caps Lock = 240
277277
{keycode: 240, entry : 0xffe5},
278278
//[186 / 58 = "~^"]
279-
{keycode: 186, entry : 0x22, browser: "IE"},
280-
{keycode: 58, entry : 0x22, guestos: "windows", browser: "Firefox"},
279+
{keycode: 186, entry : 0x3a, guestos: "windows", browser: "IE"},
280+
{keycode: 58, entry : 0x3a, guestos: "windows", browser: "Firefox"},
281+
//[226 = "_"]
282+
{keycode: 226, entry : 0x5f, guestos: "windows"},
281283
],
282284
keyPress: [
283285
// These mappings are for japanese guestOS. it is recommended that admin should deploy

systemvm/js/ajaxviewer.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ KeyboardMapper.prototype = {
200200
this.mappedInput.push({type : AjaxViewer.KEY_DOWN, code: X11Keysym, modifiers: modifiers});
201201
this.mappedInput.push({type : AjaxViewer.KEY_UP, code: X11Keysym, modifiers: modifiers});
202202
}
203-
} else {
203+
} else if(!(code == 48 && modifiers == AjaxViewer.SHIFT_KEY_MASK) && !(code == 95 && modifiers == 0)){
204204
this.mappedInput.push({type : AjaxViewer.KEY_DOWN, code: code, modifiers: modifiers});
205205
this.mappedInput.push({type : AjaxViewer.KEY_UP, code: code, modifiers: modifiers});
206206
}
@@ -239,9 +239,9 @@ KeyboardMapper.prototype = {
239239
}
240240

241241
// special handling for ALT/CTRL key
242-
if(eventType == AjaxViewer.KEY_UP && (code == AjaxViewer.JS_KEY_ALT || code == code == AjaxViewer.JS_KEY_CTRL))
242+
if(eventType == AjaxViewer.KEY_UP && (code == AjaxViewer.JS_KEY_ALT || code == code == AjaxViewer.JS_KEY_CTRL)) {
243243
this.mappedInput.push({type : eventType, code: this.jsX11KeysymMap[code], modifiers: modifiers});
244-
244+
}
245245
} else if(eventType == AjaxViewer.KEY_PRESS) {
246246
// special handling for * and + key on number pad
247247
if(code == AjaxViewer.JS_NUMPAD_MULTIPLY) {

0 commit comments

Comments
 (0)