When using mozc to input Japanese, it's using the last selected keyboard layout to input romaji - can I fix which one it uses?

enter image description here

First click on this Mozc icon and bring

enter image description here

this window and click on the red arrow, preference button,

enter image description here

Pull-down the menu from Input Method Default to your favorite.


If it is desired to keep IBus instead of switching to fcitx, the file /usr/share/ibus/component/mozc.xml can be edited as a temporary workaround:

Change <layout>default</layout> to <layout>us</layout> and restart IBus.


TLDR

Solution 1

Change the layout from ibus-mozc.xml file.

Solution 2

Edit/import the romaji-hiragana keymap from ibus-mozc to your keyboard layout.

How to do (solution 2)

To do that:

  1. Click on Gnome Status menu (Gnome's top-left bar) > IBus menu (i.e. keyboard/input language selector) > Select Japanese Mozc input method.
  2. Again, click on Gnome Status Menu > IBuz > tools > Properties > Mozc Settings window.
  3. From Keymap section > click on customize button (second one, from Romaji table).
  4. Create new entries with your specific keys to binding the romaji-hiragana keys.
  5. If messed things up, click on reset to defaults button from Mozc Settings window.

See the screenshots about how to edit your ibus-mozc

Explanation

IBUS

Every time I switch the language (e.g: english, spanish, etc) from IBUS, the keyboard layout changes. So the keys are remapped. But this is an IBUS comportment. And some users reported this issue before.

MOZC

Specifically for MOZC, it doesn't change the keyboard layout. Because Japanese (romaji) can be inserted/typed/represented by any language (phonetically).

And the most common usage is to use only one foreign language keyboard layout. So MOZC switch by your_foreign_language to japanese. It is an one-to-one relation, by default.

Alternative solutions

Install another Japanese IMEs

Just install and use another Input Method Engines (IMEs). MOZC is just one IME (a Japanese IME). Japanese IMEs from IBUS are: MOZC, anthy, SKK, KKC.

To install these IBUS Japanese IMEs:

  • MOZC: sudo apt install ibus-mozc.
  • Anthy: sudo apt install ibus-anthy.
  • KKC: sudo apt install ibus-kkc.
  • SKK: sudo apt install ibus-skk.

After install all of them, you can select the desired one by: Click on Gnome Status menu (Gnome's top-left bar) > IBus menu (i.e. keyboard/input language selector) > Select your desired (japanese) IME. You can see at the first screenshot all of them installed (see the green highlight) and showed by IBUS to be selected.

Install another IMFs

You can install a alternative for IBUS. IBUS is a type of Input Method Framework (IMF). It manages different kind of IMEs.

One suggestion is to install FCITX:

  • Fcitx: sudo apt install fcitx.
    • and you need to install the IMEs for FCITX, like:
      • sudo apt install fcitx-mozc.
      • sudo apt install fictx-kkc.
      • sudo apt install fictx-skk.
  • Ibus: sudo apt install ibus

A list of IMF can be found in List of input methods for Unix platforms and Linux input method framework brief summary.

I think with that information you can manage what can work for your local setup.