2

I'm using Gnome with an international keyboard and I configured it to use fcitx IBus. I also installed Google_Japanese_Input in Windows, where it behaves as expected:

  • Alt + Shift switch between languages (IMEs)
  • Ctrl + Caps Lock switch to Hiragana
  • Alt + Caps Lock if in alphanumeric mode change to Hiragana, then switch to Katakana
  • Shift + Caps Lock switch between full-width Hiragana ↔ full-width alphanumeric (romaji)
  • Alt + ` (Grave Accent) switch between kana ↔ half-width alphanumeric (romaji)
  • Alt + ~ (Tilde) toggle kana/direct input

These keyboard shortcuts do not work in Gnome. I have to select the modes manually from the menu.

I understand that Alt + ` interferes with the application switcher shortcut but I doubt that I'm the only user using Gnome and trying to get it to work like an average user would do on any other platform. If there was a serious issue with the existing keyboard mappings there should at least be some kind of best practice or recommendation how to create a useful mapping instead of everyone starting from scratch rolling her/his own? I'm not convinced by existing answers (1, 2) and I could not find any good resources how a Linux user is supposed to configure and use Mozc (1, 2) efficiently.

So my question I'd like to have a complete answer here is:

  • What is the recommended Japanese input method for Ubuntu 18.04 and later? (I assume it is Mozc.)
    • Which packages need to be installed?
    • How is the input method configured in Gnome? (A Windows user just downloads and installs the Google software for comparison. It just works.)
  • How to set up the input method itself?
    • How to set up switching of input modes?
    • Are there any conflicts with keyboard shortcuts? How to resolve?
    • Are there any conflicts with other IMEs or software components (like UIM, IBus)? How to resolve?
  • Is there any useful documentation how to use the IME? (Or typical Japanese IME in general.)
    • Would be useful to verify that it is working correctly.
    • Understanding how the software is supposed to be used by average users. There seem to be a lot of shortcuts and additional functionality to tweak but also to make your experience worse than instead of going with the default where possible.

Update:

After a few reboots I find that fcitx does not work when I set the mode to Hiragana and type in Gedit. Trying to reconstruct the behavior I must have been using Ibus at the time. When I try Ibus it works.

I had reset my keyboard shortcuts on this computer when I moved from Unity to Gnome, thus running the defaults except for the take screenshot key which I have disabled. I previously had setup custom compose keys (1, 2), but I disabled export GTK_IM_MODULE="uim" and export QT_IM_MODULE="uim" in my .profile when moving to Gnome with Wayland due to a bug. Sequences like Compose+.+. and Compose++ do work though.

When running fcitx I get the following output:

$ printenv | grep -i im_module 
CLUTTER_IM_MODULE=xim
QT4_IM_MODULE=fcitx
QT_IM_MODULE=fcitx
GTK_IM_MODULE=fcitx

When running ibus I get the following output:

$ printenv | grep -i im_module 
CLUTTER_IM_MODULE=xim
QT4_IM_MODULE=xim
QT_IM_MODULE=ibus
GTK_IM_MODULE=ibus

Update 2:

Okay as far as I understand fcitx does not integrate well with Gnome at the moment. I try to go with IBus since I don't want fcitx to interfere with keyboards and configure keyboards in Gnome and fcitx (across several desktops and laptops). While I have no problems using Ctrl + Caps Lock and Alt + Caps Lock in Windows, Mozc on Linux has the Japanese keys in it's mapping and the Alt and Eisu keys don't seem to be supported. There is an entry on the Arch Wiki regarding X tools (I'm not sure about Wayland) and some Japanese users seem to have found their ways, but this is way too much for me right now.

Update 3:

While users on Arch use a custom AUR package I found a simple quilt patch for easy applying and recompiling to the latest version. I hope this can be included in Ubuntu one way or another while the Linux version has no documented way of making the quoted shortcuts work like on other OSes. With this annoyance gone I consider my issue almost solved. Lets see what happens with the bug report or upstream in the mean time.

  • The shortcut key for toggle on/off Mozc by the default super + space or ctrl + space and you can change it. askubuntu.com/questions/929793/… askubuntu.com/questions/886426/… I think the best is fcitx-mozc, second ibus-mozc. the shortcut conflict has two kind one is global another is local it depends on the app on front. – Sadaharu Wakisaka Dec 27 '18 at 0:56
  • @psw1747 Thanks for your comment, but I cannot get it to work. When I try fcitx and reboot ctrl+space does not work. When I switch to Hiragana manually in Gedit it does not work. For Ibus ctrl+space does not work. Manually switching to Hiragana and typing in Gedit works though. I'm using Gnome Session, keyboard shortcuts are set to default except taking a screenshot which I disabled. I have set up a compose key on the print key (for this laptop, others have a menu key which I prefer). I updated my question with more details could you please take a look? – LiveWireBT Dec 27 '18 at 5:15
  • I'm sorry my knowledge doesn't help you. I kept using Unity after upgrading 16 to 18. There're a lot of conflicts, I have no time to correct each of them, in a few years they will be resolved and reconsider Gnome, but Xubuntu has no problem for nearly 6 years. My computer is a tool for things get done, I don't work for running itself. – Sadaharu Wakisaka Dec 27 '18 at 19:16
0

Keyboard shortcuts to enable the IME and switch modes don't work at the moment as noted in various places.

  • How to set up switching of input modes?

Using a non-japanese keyboard on Linux to do this may be difficult to setup, it's easier to use fcitx or a patched build that starts with the IME activated when using IBus (which I prefer). See update 3 in the question for details. Typing Hiragana and switching with F6-F10 when necessary seems to get most of the things done when necessary as written here.

  • Are there any conflicts with keyboard shortcuts? How to resolve?

No, I couldn't find any so far. Configuring new shortcuts or getting the special japanese keys to work may get you into more trouble though. Configuring and using shortcuts for Gnome, a Music player, byobu and Tilix sometimes already get in the way of each other. It's better not to create more worries with custom shortcuts.

  • Are there any conflicts with other IMEs or software components (like UIM, IBus)? How to resolve?

You can check with im-config (I had an .xinputrc with only commented options which got in the way, I renamed it). ibus-setup helps configuring IBus, but defaults are good as they are. I haven't found a way to make XCompose with UIM work at the same time for now, but basics like Compose+.+. work, for Emojis there is the new Charmap app.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.