google / mozc

Mozc - a Japanese Input Method Editor designed for multi-platform
Other
2.41k stars 352 forks source link

US Layout, Kana sublegends don't match up anymore. #757

Closed corigne closed 1 year ago

corigne commented 1 year ago

Description As per the linked issue, the US layout and Default/JP layouts needed a toggle feature, and the feature update allowed us layout users to change their proto config to choose the correct layout for their keyboard. I actually replied to this issue, as this was a fix for my layout problems, until recently.

I'm not sure when this change occurred exactly, as I sometimes go a few weeks at a time without utilizing kana typing. My keycaps for [ ] and \ on the US keyboard are labeled ゛゜む with sub legends 「」and nothing, respectively. When I replied to that thread, the layout matched what is printed on my keycaps when I had "us" configured as the layout in the textproto config file.

However, now I have to press shift+゜for「 and shift+む for 」which doesn't match the layout of my keycaps.

427 This is the issue in question where I reported my layout was working using the US layout setting.

Steps to reproduce Steps to reproduce the behavior:

  1. Have "us" configured as the layout for mozc in .config/mozc/ibus_config.textproto
  2. Attempt to type 「 or 」and instead type ゛and「 respectively.

Expected behavior image The above image depicts the typical US layout with Kana sub-legends on the keycaps and how they are arranged on my keyboard. Shift + ゛( [ on the US printed cap) = 「 Shift + ゜( ] on the US printed cap) = 」 \ ( on the US keyboard) must retain む

Actual behavior image The "us" layout now mimics the Windows 10 IME virtual keyboard layout instead of an actual US keyboard layout. As a result, I attempt to type 「 or 」and instead type ゛and「 respectively.

Version or commit-id [e.g. Mozc-2.28.4960.100+24.11.oss or d50a8b9ae28c4fba265f734b38bc5ae392fe4d25] You can get the version string by converting "Version" or "ばーじょん". 2.26.4220.102

Environment

             /////////////                nexus@ishimura 
         /////////////////////            -------------- 
      ///////*767////////////////         OS: Pop!_OS 22.04 LTS x86_64 
    //////7676767676*//////////////       Kernel: 6.2.6-76060206-generic 
   /////76767//7676767//////////////      Uptime: 51 mins 
  /////767676///*76767///////////////     Packages: 3626 (dpkg), 59 (flatpak), 12 (snap) 
 ///////767676///76767.///7676*///////    Shell: zsh 5.8.1 
/////////767676//76767///767676////////   Resolution: 2560x1440, 2560x1440 
//////////76767676767////76767/////////   WM: i3 
///////////76767676//////7676//////////   Theme: Pop-dark [GTK2/3] 
////////////,7676,///////767///////////   Icons: Nordic-darker [GTK2/3] 
/////////////*7676///////76////////////   Terminal: terminator 
///////////////7676////////////////////   CPU: AMD Ryzen 7 3800X (16) @ 4.200GHz 
 ///////////////7676///767////////////    GPU: NVIDIA GeForce RTX 2070 SUPER 
  //////////////////////'////////////     Memory: 3991MiB / 31995MiB 
   //////.7676767676767676767,//////
    /////767676767676767676767/////                               
      ///////////////////////////                                 
         /////////////////////
             /////////////

Investigations

hiroyuki-komatsu commented 1 year ago

Hi corigne,

We follow the JIS Kana layout. I think the Windows 10 IME virtual keyboard layout also follows it.

https://ja.wikipedia.org/wiki/%E3%81%8B%E3%81%AA%E5%85%A5%E5%8A%9B kana kana shift

If you want to use other layouts, you can use the romaji configuration table discussed in #427, or modify the source code and rebuild it. https://github.com/google/mozc/blob/2030eb4a98b3ef30d2b618a2aa32bf2b17f463fd/src/unix/ibus/key_translator.cc#L255

Thanks,

corigne commented 1 year ago

Thank you for the response. Why does mozc provide a configuration option for separate US and JP layouts if the US layout doesn't follow a common US keyboard layout standard? Also, while I appreciate the default is the JIS standard, this answer doesn't address the issue that the US layout did at one point work correctly for standard US keyboards.

Edit: To elaborate, in my ticket I mentioned that the "us" layout worked for my configuration up until fairly recently.

Would it be possible to restore the US layout to one that US keyboards typically use, or to add a third layout option in the configuration for US layout users who do not have JIS standard keyboards?

hiroyuki-komatsu commented 1 year ago

In terms of the Kana layout, our intention is to provide the same character positions between US and JP layouts.

For example, to type ゅ (small YU), you need to press Shift+8. In the implementation, Shift+8 is sent as ( from JP layout while it is sent as * from US layout. To fill this gap, we have separate US and JP layouts for Kana layout.

We think the JIS Kana layout is the standard kana layout for all latin keyboard layouts including US and JP. This is also the same behavior with the Windows IME.

If you prefer other Kana layout variants, I believe the romaji configuration table should work as well as other romaji layout variants as discussed in #427.

Best,

hiroyuki-komatsu commented 1 year ago

Closing this issue.

Please feel free to reopen it, if my previous comment does not address your issue. Thank you,