Japanese keyboard patch

o Add Japanese key
    HIRAGANA
    CONVERT_JP
    NONCONVERT_JP
  o set Japanese keyboard
    kbd_type    : 7
    kbd_subtype : 2
    kbd_fn_keys : 12
This commit is contained in:
Hiroshi Akashio 2012-08-25 01:25:59 +09:00
parent 577b8e30eb
commit 61eabe3048
4 changed files with 23 additions and 1 deletions

View File

@ -195,5 +195,6 @@ FREERDP_API const char* freerdp_keyboard_get_layout_name_from_id(uint32 keyboard
FREERDP_API RDP_SCANCODE freerdp_keyboard_get_rdp_scancode_from_x11_keycode(uint32 keycode);
FREERDP_API uint32 freerdp_keyboard_get_x11_keycode_from_rdp_scancode(uint32 scancode, boolean extended);
FREERDP_API RDP_SCANCODE freerdp_keyboard_get_rdp_scancode_from_virtual_key_code(uint32 vkcode);
FREERDP_API void freerdp_keyboard_set_layout_code(rdpSettings* settings);
#endif /* __FREERDP_LOCALE_KEYBOARD_H */

View File

@ -56,6 +56,9 @@ boolean freerdp_connect(freerdp* instance)
rdp = instance->context->rdp;
/* Advanced settings for keyboard layout */
freerdp_keyboard_set_layout_code(rdp->mcs->transport->settings);
IFCALLRET(instance->PreConnect, status, instance);
extension_load_and_init_plugins(rdp->extension);

View File

@ -111,3 +111,18 @@ RDP_SCANCODE freerdp_keyboard_get_rdp_scancode_from_virtual_key_code(uint32 vkco
{
return VIRTUAL_KEY_CODE_TO_DEFAULT_RDP_SCANCODE_TABLE[vkcode];
}
/**
* Set keyboard layout(kbd_type,kbd_subtype,kbd_fn_keys).\n
* @param settings rdp settings
*/
void freerdp_keyboard_set_layout_code(rdpSettings* settings)
{
/* for jp */
if (settings->kbd_layout == 0xE0010411) {
settings->kbd_type = 7;
settings->kbd_subtype = 2;
settings->kbd_fn_keys = 12;
}
}

View File

@ -151,7 +151,10 @@ XKB_KEY_NAME_SCANCODE XKB_KEY_NAME_SCANCODE_TABLE[] =
{ "KPDV", RDP_SCANCODE_DIVIDE}, // KP!
{ "RCTL", RDP_SCANCODE_RCONTROL},
{ "RALT", RDP_SCANCODE_RMENU},
{ "AE13", RDP_SCANCODE_BACKSLASH_JP} // JP
{ "AE13", RDP_SCANCODE_BACKSLASH_JP}, // JP
{ "HKTG", RDP_SCANCODE_HIRAGANA}, // JP
{ "HENK", RDP_SCANCODE_CONVERT_JP}, // JP
{ "MUHE", RDP_SCANCODE_NONCONVERT_JP} // JP
/* { "LVL3", 0x54} */
};