xen/vnc-i18n-keys.diff

134 lines
4.7 KiB
Diff

Index: xen-3.1-testing/tools/ioemu/sdl_keysym.h
===================================================================
--- xen-3.1-testing.orig/tools/ioemu/sdl_keysym.h
+++ xen-3.1-testing/tools/ioemu/sdl_keysym.h
@@ -274,5 +274,27 @@ static name2keysym_t name2keysym[]={
{"Pause", SDLK_PAUSE},
{"Escape", SDLK_ESCAPE},
+ /* dead keys */
+{"dead_grave", 0xfe50},
+{"dead_acute", 0xfe51},
+{"dead_circumflex", 0xfe52},
+{"dead_tilde", 0xfe53},
+{"dead_macron", 0xfe54},
+{"dead_brev", 0xfe55},
+{"dead_abovedot", 0xfe56},
+{"dead_diaeresis", 0xfe57},
+{"dead_abovering", 0xfe58},
+{"dead_doubleacute", 0xfe59},
+{"dead_caron", 0xfe5a},
+{"dead_cedilla", 0xfe5b},
+{"dead_ogonek", 0xfe5c},
+{"dead_iota", 0xfe5d},
+{"dead_voiced_sound", 0xfe5e},
+{"dead_semivoiced_sound", 0xfe5f},
+{"dead_belowdot", 0xfe60},
+{"dead_hook", 0xfe61},
+{"dead_horn", 0xfe62},
+
{0,0},
};
+
Index: xen-3.1-testing/tools/ioemu/vnc_keysym.h
===================================================================
--- xen-3.1-testing.orig/tools/ioemu/vnc_keysym.h
+++ xen-3.1-testing/tools/ioemu/vnc_keysym.h
@@ -291,10 +291,34 @@ static name2keysym_t name2keysym[]={
{"BackApostrophe", 0xff21},
{"Muhenkan", 0xff22},
{"Katakana", 0xff25},
-{"Zenkaku_Hankaku", 0xff29},
+{"Hankaku", 0xff29},
+{"Zenkaku_Hankaku", 0xff2a},
{"Henkan_Mode_Real", 0xff23},
{"Henkan_Mode_Ultra", 0xff3e},
{"backslash_ja", 0xffa5},
+ /* dead keys */
+{"dead_grave", 0xfe50},
+{"dead_acute", 0xfe51},
+{"dead_circumflex", 0xfe52},
+{"dead_tilde", 0xfe53},
+{"dead_macron", 0xfe54},
+{"dead_brev", 0xfe55},
+{"dead_abovedot", 0xfe56},
+{"dead_diaeresis", 0xfe57},
+{"dead_abovering", 0xfe58},
+{"dead_doubleacute", 0xfe59},
+{"dead_caron", 0xfe5a},
+{"dead_cedilla", 0xfe5b},
+{"dead_ogonek", 0xfe5c},
+{"dead_iota", 0xfe5d},
+{"dead_voiced_sound", 0xfe5e},
+{"dead_semivoiced_sound", 0xfe5f},
+{"dead_belowdot", 0xfe60},
+{"dead_hook", 0xfe61},
+{"dead_horn", 0xfe62},
+
+
{0,0},
};
+
Index: xen-3.1-testing/tools/python/xen/xend/XendOptions.py
===================================================================
--- xen-3.1-testing.orig/tools/python/xen/xend/XendOptions.py
+++ xen-3.1-testing/tools/python/xen/xend/XendOptions.py
@@ -278,6 +278,9 @@ class XendOptions:
return self.get_config_string('vncpasswd',
self.vncpasswd_default)
+ def get_keymap(self):
+ return self.get_config_value('keymap', None)
+
class XendOptionsFile(XendOptions):
"""Default path to the config file."""
Index: xen-3.1-testing/tools/python/xen/xend/XendConfig.py
===================================================================
--- xen-3.1-testing.orig/tools/python/xen/xend/XendConfig.py
+++ xen-3.1-testing/tools/python/xen/xend/XendConfig.py
@@ -27,6 +27,7 @@ from xen.xend.XendError import VmError
from xen.xend.XendDevices import XendDevices
from xen.xend.PrettyPrint import prettyprintstring
from xen.xend.XendConstants import DOM_STATE_HALTED
+from xen.xend import XendOptions
log = logging.getLogger("xend.XendConfig")
log.setLevel(logging.WARN)
@@ -389,6 +390,8 @@ class XendConfig(dict):
self['name_label'] = 'Domain-' + self['uuid']
def _platform_sanity_check(self):
+ if 'keymap' not in self['platform'] and XendOptions.instance().get_keymap():
+ self['platform']['keymap'] = XendOptions.instance().get_keymap()
if self.is_hvm():
if 'device_model' not in self['platform']:
self['platform']['device_model'] = DEFAULT_DM
Index: xen-3.1-testing/tools/examples/xend-config.sxp
===================================================================
--- xen-3.1-testing.orig/tools/examples/xend-config.sxp
+++ xen-3.1-testing/tools/examples/xend-config.sxp
@@ -197,3 +197,7 @@
# The default password for VNC console on HVM domain.
# Empty string is no authentication.
(vncpasswd '')
+
+# The default keymap to use for the VM's virtual keyboard.
+#(keymap 'en-us')
+
Index: xen-3.1-testing/tools/python/xen/xend/XendDomainInfo.py
===================================================================
--- xen-3.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-3.1-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -1336,6 +1336,9 @@ class XendDomainInfo:
if devclass in XendDevices.valid_devices():
log.info("createDevice: %s : %s" % (devclass, scrub_password(config)))
dev_uuid = config.get('uuid')
+ if 'keymap' not in config:
+ if 'keymap' in self.info['platform']:
+ config['keymap'] = self.info['platform']['keymap']
devid = self._createDevice(devclass, config)
# store devid in XendConfig for caching reasons