Santhu / mozc

Automatically exported from code.google.com/p/mozc
0 stars 0 forks source link

Support "ひらがな/カタカナ" key on Mozc-clients which directly or indirectly depend on XKB #136

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Open config dialog and enter key binding editor.
2. For "Hiragana (ひらがな)" key or "Katakana (カタカナ)" key, assign 
any command, say "Launch config dialog (プロパティを起動)".
3. Open gedit and hit "Hiragana/Katakana" or "Shift + Hiragana/Katakana"

What is the expected output?
Assigned key command is processed.

What do you see instead?
(Probably) nothing happens.

Background:
On 106/109 Japanese keyboard, there is a key labeled "ひらがな/カタカナ"
http://ja.wikipedia.org/wiki/%E3%82%AD%E3%83%BC%E9%85%8D%E5%88%97#109.E3.82.AD.E
3.83.BC.E3.83.9C.E3.83.BC.E3.83.89

On the other hand, the XKB defines three types of logical key code: 
"xkb::Hiragana", "xkb::Katakana" and "xkb::Hiragana_Katakana".

In real world settings on most GNU/Linux distributions, any key event against 
physical "ひらがな/カタカナ" key is likely to be mapped into 
"xkb::Hiragana_Katakana" regardless of the state of shift modifier. This means 
that you are likely to receive "Shift + xkb::Hiragana_Katakana" rather than 
"xkb::Katakana" when you physically press Shift + "ひらがな/カタカナ".

Unfortunately, Mozc protocol expects that Shift + "ひらがな/カタカナ" 
key event is always interpret as "{special_key: 
mozc::commands::KeyEvent::KATAKANA}" without shift modifier. Thus all the Mozc 
clients which directly or indirectly depend on XKB are responsible for 
implementing this interpretation. Actually, "IBUS_Hiragana_Katakana" on IBus or 
"SCIM_KEY_Hiragana_Katakana" on SCIM seem to be just a synonym of 
"xkb::Hiragana_Katakana". So ibus-mozc and scim-mozc are also involved this 
problem.

As of r96, following implementations should be updated to handle 
"ひらがな/カタカナ" key correctly.
- http://code.google.com/p/mozc/source/browse/trunk/src/unix/emacs/mozc.el?r=96
- 
http://code.google.com/p/mozc/source/browse/trunk/src/unix/ibus/key_translator.c
c?r=96
- 
http://code.google.com/p/mozc/source/browse/trunk/src/unix/scim/scim_key_transla
tor.cc?r=93

Original issue reported on code.google.com by yukawa@google.com on 13 Mar 2012 at 9:36

GoogleCodeExporter commented 9 years ago
Fixed in r105.

Note that scim-mozc has not implemented all of the Mozc features. Due to this 
limitation, some commands such as "Launch config dialog 
(プロパティを起動)" or "Set input mode to Hiragana 
(ひらがなに入力切替)" do not work correctly on scim-mozc regardless of 
what key is assigned to such unsupported commands.

Original comment by yukawa@google.com on 26 Mar 2012 at 10:21