Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for a Japanese keyboard layout in fcitx5-mozc #8

Closed
hexclover opened this issue Dec 6, 2020 · 1 comment
Closed

Check for a Japanese keyboard layout in fcitx5-mozc #8

hexclover opened this issue Dec 6, 2020 · 1 comment

Comments

@hexclover
Copy link

hexclover commented Dec 6, 2020

It seems to me that Mozc in Kana mode always uses a char-to-kana mapping designed for the US keyboard layout, for example

` => ろ
[ => ゛

etc. This became problematic when I tried with a Japanese keyboard layout, where these mapping should be

\ => ろ
@ => ゛

and so on.

I followed the discussion google#427 and found a correct mapping already present in src/unix/fcitx5/fcitx_key_translator.cc, and that this mapping is used in the series of translator functions as long as the arguments called layout_is_jp is set to true.

However, in src/unix/fcitx5/fcitx_key_translator.cc, which I believe all these layout_is_jp's originate from, I found that it is always specified as false:

  // TODO: check layout
  if (mozc_state->ProcessKeyEvent(event.rawKey().sym(), event.rawKey().code(),
                                  event.rawKey().states(), false,
                                  event.isRelease())) {
    event.filterAndAccept();
  }

So it seems to me that the detection of a JP keyboard layout hasn't been implemented for fcitx5-mozc.

Do you have time to implement this, or comment on how to implement it correctly? My understanding is to check the keyboard layout configured in the fcitx5 config tool (per group or per input method).

Thank you.

@wengxt wengxt closed this as completed in e7a97d0 Dec 6, 2020
@hexclover
Copy link
Author

Confirmed it works for me, thanks for your prompt response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant