Never use ibus's US keymap in bus_input_context_filter_key, and use the keyval from...
authorYusuke Sato <yusukes@chromium.org>
Tue, 15 Feb 2011 01:24:20 +0000 (10:24 +0900)
committerYusuke Sato <yusukes@chromium.org>
Tue, 15 Feb 2011 01:24:20 +0000 (10:24 +0900)
commit5743b6da70f7722792c21ec50415dce4f1790af5
tree428f333a28839542b63365038349f1e034e52316
parentc394fea7874df0173cf07d891976086ab343bead
Never use ibus's US keymap in bus_input_context_filter_key, and use the keyval from X as-is.
I think this is important for supporting non-US keyboards like a Japanese-106 keyboard correctly.

Currently, when use_sys_layout config is unchecked (the default), ibus-daemon discards a keyval being passed from X, and regenerates a keyval from a keycode assuming the US layout.

However, I believe this behavior is not good for non-US keyboard layout users (e.g. Japanese or Korean keyboard users.) For example, the Japanese 106 keyboard has a key called Zenkaku_Hankaku (全角_半角, whose keycode is 49) on the left hand of the '1' key, and most users want to use the key for toggling IME. But, even if a user set 'Zenkaku_Hankaku' as the toggle hotkey using ibus-setup, the user cannot toggle IME unless the 'Use system keyboard layout' option is explicitly turned on. This is because when use_sys_layout is unchecked, ibus-daemon treats the Zenkaku_Hankaku key press (keycode=49) as tilde (~) key press (remember that the tilde's keycode is also 49 in the US keyboard layout.) This is very inconvenient and confusing.

Please also note that the hotkey configuration tool in ibus-setup always respects a keyval from X, and never checks the use_sys_layout value.

Review URL: http://codereview.appspot.com/4173046
bus/inputcontext.c