I have a Japanese 108-key keyboard that I have been using for a long time on en-US Windows 7. It works correctly including keys that switch alpha/hiragana/katakana etc.
Recently I installed Ubuntu 18.04 as dual-boot on the same desktop and keyboard.
Japanese has been added in Language Support.
In Settings → Regions & Language → Input Sources, I added Japanese, and “Japanese” for the keyboard type (there is no 106/109 keyboard layout).
It seems to recognize this keyboard since it correctly matches some special character positions that are different from an en-US keyboard.
But keys for switching half-width/full width, hiragana/katakana etc. do nothing.
I checked some related questions but it seems to be an unanswered topic. Surely Ubuntu is used in Japan so I expect there is some solution or workaround.
I would like to learn the setup if anyone is successfully using such a keyboard. AFAIK, IME should be a separate matter. I have ibus and fcitx installed but maybe that’s a next step.
Well I did some more research on this.
First, setup Japanese language support and install ibus. I would remove fcitx if it is there, as I read this might cause problems. I won't repeat these steps since they are well documented, but at this point you should see the following in Settings -> Region and Language:
To get the keyboard switching, I found two additional steps are needed.
Follow the steps on this page: Ubuntu で日本語キーボードレイアウト It's in Japanese, but the steps are easy to follow.
Follow the instruction in the answer here: Japanese (Mozc) Wrong Keyboard Layout to modify mozc.xml.
mozc.xml can't be modified without root privileges, so it needs to be edited from the Terminal. In the directory containing mozc.xml, I used
sudo nano mozc.xml
Then restart.
Open some text app., and now hankaku/zenkaku or katakana/hiragana keys switch function as expected. For kana, the IME works as expected.
Half width you should see:
Full width you should see this:
To change the keyboard layout to a 106/109 Japanese keyboard layout with Japanese (Mozc) input:
On Ubuntu 20.10 and earlier:
Edit the mozc.xml file by entering the following command in a terminal:
sudo gedit /usr/share/ibus/component/mozc.xml
Change
<layout>default</layout>
to<layout>jp</layout>
and save.Log out and then back into Ubuntu for the change to take effect.
On Ubuntu 21.04 and later:
Edit the ibus_config.textproto file by entering the following command in a terminal:
gedit ~/.mozc/ibus_config.textproto
(Or possibly:~/.config/mozc/ibus_config.textproto
)Change
layout : "default"
tolayout : "jp"
and save.Log out and then back into Ubuntu for the change to take effect.
Have you tried switching off PC and then switching on manually instead of rebooting? E.g. Russian Dvorak layout starts working after reboot.
Have you tried removing keyboards except Japanese or except Japanese and English if you are going to reboot? E.g. English Dvorak layout starts working after removing English QWERTY layout.