rdp: Support using Japanese layouts with US keyboards

When RDP indicates that a Japanese keyboard layout is used without
a Japanese 106/109 keyboard (keyboard type 7), use the "us" layout,
since the "jp" layout in xkb expects the Japanese 106/109 keyboard
layout.

Co-authored-by: Steve Pronovost <spronovo@microsoft.com>
Co-authored-by: Brenton DeGeer <brdegeer@microsoft.com>
Signed-off-by: Hideyuki Nagase <hideyukn@microsoft.com>
Signed-off-by: Steve Pronovost <spronovo@microsoft.com>
Signed-off-by: Brenton DeGeer <brdegeer@microsoft.com>
dev
Hideyuki Nagase 3 years ago committed by Derek Foreman
parent 5d939bc636
commit 6515df1333
  1. 8
      libweston/backend-rdp/rdp.c

@ -849,7 +849,15 @@ convert_rdp_keyboard_to_xkb_rule_names(UINT32 KeyboardType,
xkbRuleNames->variant = "kr104"; /* kr(ralt_hangul)/kr(rctrl_hanja) */
else if (KeyboardSubType == 6) /* PC/AT 103 Enhanced Korean Keyboard */
xkbRuleNames->variant = "kr106"; /* kr(hw_keys) */
} else if (KeyboardType != KBD_TYPE_JAPANESE && ((KeyboardLayout & 0xFFFF) == 0x411)) {
/* when Japanese keyboard layout is used without a Japanese 106/109
* keyboard (keyboard type 7), use the "us" layout, since the "jp"
* layout in xkb expects the Japanese 106/109 keyboard layout.
*/
xkbRuleNames->layout = "us";
xkbRuleNames->variant = 0;
}
weston_log("%s: matching model=%s layout=%s variant=%s options=%s\n",
__func__, xkbRuleNames->model, xkbRuleNames->layout,
xkbRuleNames->variant, xkbRuleNames->options);

Loading…
Cancel
Save