[1] ajaxkeys.js : /usr/share/cloudstack-common/systemvm/js/
[2] ajaxkviewer.js : /usr/share/cloudstack-common/systemvm/js/
[3] consoleKeyboardOptions.jsp : /usr/share/cloudstack-management/webapps/client/
[1] Support for non-US keyboards in Console Proxy
Bold Italic designates added/modified values
After the framework changes as mentioned in [1], It is easier to add support for non-US keyboard for console proxy. To do so one has to just add the mappings for their locale keyboard in one designated file.
To add new keyboard for console proxy add the corresponding parameters in file consoleKeyboardOptions file [3] consoleKeyboardOptions.jsp
for example say file consoleKeyboardOptions file [3] consoleKeyboardOptions.jsp is looking like below
...
<option value="us"><fmt:message key="label.standard.us.keyboard" /></option> |
<option value="uk"><fmt:message key="label.uk.keyboard" /></option> |
<option value="jp"><fmt:message key="label.japanese.keyboard" /></option> |
<option value="fr">French AZERTY keyboard</option> |
<option value="sc"><fmt:message key="label.simplified.chinese.keyboard" /></option> |
Add the keyboard in file file [1] ajaxkeys.js also. Where to add the keyboard option in ajaxkeysfile [1] ajaxkeys.js will depend upon your keyboard layout.
We divide the keyboard layout into two categories cooked keyboard and raw keyboard.
Cooked keyboard is any keyboard which is very similar to US keyboard with some keys not matching. Example UK, FR, US
Raw keyboard is any keyboard which has very different layout than US keyboard for example Japanese JP.
...
To add the cooked keyboard type, add in below section in ajakeys.js
...
"sc":"Simplified Chinese keyboard"}
Make a note "sc" key is same as value in file [3] consoleKeyboardOptions.jsp
After the adding keyboard in one of above categories its time to define the key mappings. Focus should be on those keys which are not working by default.
It will be good practice to add the constant for your keyboard. To do so add constant in below section. For example to add constant for simplified Chinese add it as shown below
Add the constant for your keyboard type in section.
...
[1] ajaxkeys.js : /usr/share/cloudstack-common/systemvm/js/
[2] ajaxkviewer.js : /usr/share/cloudstack-common/systemvm/js/
[3] consoleKeyboardOptions.jsp : /usr/share/cloudstack-management/webapps/client/
...
[1] Support for non-US keyboards in Console Proxy