Repository: cloudstack Updated Branches: refs/heads/master 3a3e5cbbb -> 4796cceb3
CLOUDSTACK-7373: Incorrect Japanese keyboard mapping with CentOS CLI guestOS on VMware. Fixed the jp keyboard issues for VMs deployed with keyboard=jp param. Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/4796cceb Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/4796cceb Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/4796cceb Branch: refs/heads/master Commit: 4796cceb3464d3db8ec4cd71e334ff5b00285e1b Parents: 3a3e5cb Author: Sanjay Tripathi <sanjay.tripa...@citrix.com> Authored: Mon Sep 15 16:02:17 2014 +0530 Committer: Sanjay Tripathi <sanjay.tripa...@citrix.com> Committed: Mon Sep 15 16:16:45 2014 +0530 ---------------------------------------------------------------------- systemvm/js/ajaxkeys.js | 69 +++--------------------------------------- systemvm/js/ajaxviewer.js | 6 +++- 2 files changed, 9 insertions(+), 66 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4796cceb/systemvm/js/ajaxkeys.js ---------------------------------------------------------------------- diff --git a/systemvm/js/ajaxkeys.js b/systemvm/js/ajaxkeys.js index f186c1d..f992c62 100644 --- a/systemvm/js/ajaxkeys.js +++ b/systemvm/js/ajaxkeys.js @@ -275,76 +275,15 @@ var keyboardTables = [ {keycode: 244, entry : 0x7e, browser: "IE"}, //Caps Lock = 240 {keycode: 240, entry : 0xffe5}, - /* - {keycode: JS_KEY_MULTIPLY, entry : [ - {type: KEY_DOWN, code: X11_KEY_SHIFT, modifiers: 0 }, - {type: KEY_DOWN, code: X11_KEY_ASTERISK, modifiers: 0 }, - {type: KEY_UP, code: X11_KEY_ASTERISK, modifiers: 0 }, - {type: KEY_UP, code: X11_KEY_SHIFT, modifiers: 0 } - ]}, - {keycode: JS_KEY_ADD, entry : false} - */ //[186 / 58 = "~^"] {keycode: 186, entry : 0x22, browser: "IE"}, {keycode: 58, entry : 0x22, guestos: "windows", browser: "Firefox"}, ], keyPress: [ - // 34 : " " " - {keycode: 34, entry: [{type: KEY_DOWN, code: 0x22, modifiers: 64, shift: true }]}, - {keycode: 42, entry: 0xffaa }, - // 39 : " ' " (shift+7) - {keycode: 39, entry: [ - {type: KEY_DOWN, code: X11_KEY_SHIFT, modifiers: 0, shift: false }, - {type: KEY_DOWN, code: 0x22, modifiers: 0, shift: false }, - {type: KEY_UP, code: 0x22, modifiers: 0, shift: false }, - {type: KEY_UP, code: X11_KEY_SHIFT, modifiers: 0, shift: false }, - {type: KEY_DOWN, code: 0x22, modifiers: 0, shift: true }, - {type: KEY_UP, code: 0x22, modifiers: 0, shift: true }, - ]}, //58 : " : " - {keycode: 58, entry: [ - {type: KEY_DOWN, code: X11_KEY_SHIFT, modifiers: 0, shift: false }, - {type: KEY_DOWN, code: 0x3a, modifiers: 0, shift: false }, - {type: KEY_UP, code: 0x3a, modifiers: 0, shift: false }, - {type: KEY_UP, code: X11_KEY_SHIFT, modifiers: 0, shift: false }, - {type: KEY_DOWN, code: 0x3a, modifiers: 0, shift: true }, - {type: KEY_UP, code: 0x3a, modifiers: 0, shift: true }, - ]}, - // 94 : "^" - {keycode: 94, entry: [ - {type: KEY_DOWN, code: X11_KEY_SHIFT, modifiers: 0, shift: false }, - {type: KEY_DOWN, code: 0x36, modifiers: 0, shift: false }, - {type: KEY_UP, code: 0x36, modifiers: 0, shift: false }, - {type: KEY_UP, code: X11_KEY_SHIFT, modifiers: 0, shift: false }, - {type: KEY_DOWN, code: 0x36, modifiers: 0, shift: true }, - {type: KEY_UP, code: 0x36, modifiers: 0, shift: true }, - ]}, - // 64 : "@" - {keycode: 64, entry: [ - {type: KEY_DOWN, code: X11_KEY_SHIFT, modifiers: 0, shift: false }, - {type: KEY_DOWN, code: 0x32, modifiers: 0, shift: false }, - {type: KEY_UP, code: 0x32, modifiers: 0, shift: false }, - {type: KEY_UP, code: X11_KEY_SHIFT, modifiers: 0, shift: false }, - {type: KEY_DOWN, code: 0x32, modifiers: 0, shift: true }, - {type: KEY_UP, code: 0x32, modifiers: 0, shift: true }, - ]}, - // 96 : "'" - {keycode: 96, entry: [ - {type: KEY_DOWN, code: X11_KEY_SHIFT, modifiers: 0, shift: false }, - {type: KEY_DOWN, code: 0x7e, modifiers: 0, shift: false }, - {type: KEY_UP, code: 0x7e, modifiers: 0, shift: false }, - {type: KEY_UP, code: X11_KEY_SHIFT, modifiers: 0, shift: false }, - {type: KEY_DOWN, code: 0x7e, modifiers: 0, shift: true }, - {type: KEY_UP, code: 0x7e, modifiers: 0, shift: true }, - ]}, - // 61 : "=" - {keycode: 61, entry: [ - {type: KEY_DOWN, code: X11_KEY_SHIFT, modifiers: 0, shift: false }, - {type: KEY_DOWN, code: 0x3d, modifiers: 0, shift: false }, - {type: KEY_UP, code: 0x3d, modifiers: 0, shift: false }, - {type: KEY_UP, code: X11_KEY_SHIFT, modifiers: 0, shift: false }, - {type: KEY_DOWN, code: 0x3d, modifiers: 0, shift: true }, - {type: KEY_UP, code: 0x3d, modifiers: 0, shift: true }, - ]}, + // These mappings are for japanese guestOS. it is recommended that admin should deploy + // the VM with "keyboard=jp" paramenter or change the VM properties in hypervisor to use jp mapping. + {keycode: 42, entry: 0xffaa}, // * + {keycode: 43, entry: 0xffab}, // + ] } }, {tindex: 2, keyboardType: KEYBOARD_TYPE_UK, mappingTable: http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4796cceb/systemvm/js/ajaxviewer.js ---------------------------------------------------------------------- diff --git a/systemvm/js/ajaxviewer.js b/systemvm/js/ajaxviewer.js index 5394077..5b5e805 100644 --- a/systemvm/js/ajaxviewer.js +++ b/systemvm/js/ajaxviewer.js @@ -161,7 +161,7 @@ KeyboardMapper.prototype = { } var X11Keysym = code; - if(this.jsX11KeysymMap[code] != undefined && (guestos == 'windows' || modifiers != AjaxViewer.SHIFT_KEY_MASK)) { + if(this.jsX11KeysymMap[code] != undefined && (guestos == 'windows' || modifiers != AjaxViewer.SHIFT_KEY_MASK || code == AjaxViewer.JS_KEY_CAPSLOCK)) { X11Keysym = this.jsX11KeysymMap[code]; if(typeof this.jsX11KeysymMap[code] == "boolean") { return; @@ -184,6 +184,10 @@ KeyboardMapper.prototype = { this.mappedInput.push({type : eventType, code: this.jsX11KeysymMap[code], modifiers: modifiers}); } else if(eventType == AjaxViewer.KEY_PRESS && guestos == 'null') { + // ENTER/BACKSPACE key should already have been sent through KEY DOWN/KEY UP event + if(code == AjaxViewer.JS_KEY_ENTER || code == AjaxViewer.JS_KEY_BACKSPACE) + return; + var X11Keysym = code; X11Keysym = this.jsKeyPressX11KeysymMap[code]; if(X11Keysym) {