Skip to main content

Fcitx 5 Issues

I am configuring a new system, and I tried out the Fcitx 5 input method framework. It looks nice, but I have two issues that I have not been able to resolve. I will revert to Fcitx 4, but I will first document the issues in this blog entry. If anybody knows how to solve them, please let me know!

Terminal Input

For those who are familiar with input managers: I am unable to get rxvt-unicode to use the OverTheSpot or OnTheSpot preedit type with Fcitx 5.

For those unfamiliar with input managers, I shall explain. The vast majority of my input on a computer is in terminal applications, and my preferred terminal emulator is rxvt-unicode. I often write Japanese, which is done using an input method editor (“IME”). I currently use the Mozc IME most often, but I have other IMEs installed for when I need them. Fcitx is software that manages the various IMEs, making it easy to use them all.

When writing Japanese using an IME, the Japanese text has to be “composed” from the keystrokes. For example, different Japanese kanji has the same pronunciation, so the IME provides a way to select the one that you want. On the screen, the text can be composed in different locations, referred to as “preedit” types.

  • OnTheSpot - The text is composed directly in the application. For example, I use LibreOffice with this preedit type. When inserting Japanese in the middle of text, the existing text is moved to make room for the new text as it is composed. Note that a “candidate window” is displayed over the point of insertion when selecting candidate kanji.
  • OverTheSpot - The text is composed in a “preedit window” that is displayed over the point of insertion. This is the preedit type that rxvt-unicode uses with Fcitx 4.
  • OffTheSpot - The text is composed in a “preedit window” that is displayed at the bottom of the application window. This is the preedit type that rxvt-unicode uses with Fcitx 5. I do not like it because I have to move my eyes too much to change focus between the application text and the preedit window.
  • Root - The text is composed in a “preedit window” that is displayed outside of the application window. I rarely see this preedit type used these days.

The rxvt-unicode page on the Japanese ArchWiki includes a section on configuring the input method. Following the instructions, I tried the following configuration.

URxvt.inputMethod: fcitx
URxvt.preeditType: OnTheSpot

URxvt.perl-lib: /usr/lib/urxvt/perl
URxvt.perl-ext:
URxvt.perl-ext-common: xim-onthespot

This did not work, but I discovered an option to enable the OnTheSpot preedit type in the X Input Method Frontend module of Fcitx 5. After restarting Fcitx, Japanese composition in rxvt-unicode changed! Japanese text was composed directly in the terminal. Existing text was not moved as the new text was composed, but that does not matter to me. Unfortunately, the candidate window is displayed at the bottom of the application (OffTheSpot), which defeats the purpose.

I tried changing the preedit type to OverTheSpot, but that did not work. The urxvt(7) man page suggested setting a locale for the IME, but doing so did not help.

URxvt.imLocale: ja_JP.UTF-8

One possible way to work around this issue is to simply stop using rxvt-unicode. I would lose some nice features, but I could use Alacritty instead. Japanese composition in Alacritty uses OverTheSpot without issue.

Japanese Keyboard

For those who are familiar with Japanese keyboards, I am unable to configure Fcitx 5 and Mozc to use the 「カタカナ/ひらがな」 key on a Japanese keyboard.

For those unfamiliar with Japanese keyboards, I shall explain. I have been using a Japanese keyboard since the late 90s. I prefer Japanese keyboards because they have four keys that help with Japanese input.

  • The 「半角/全角」 key, located at the top left of the keyboard below the escape key, is used to toggle Japanese input. I greatly prefer having a key for this over using a combination of keys. I really dislike the use of Shift+Space because it is so easy to type it accidentally.
  • The 「無変換」 key, located to the left of the space bar, is used to toggle the text that is currently being composed between hiragana, katakana, and half-width katakana.
  • The 「変換」 key, located to the right of the space bar, is used to iterate through conversion candidates. It behaves a bit differently from the space bar in some IMEs, but it behaves the same in the IMEs that I use on Linux, so I do not need this key.
  • The 「カタカナ/ひらがな」 key, located to the right of the 「変換」 key, is used to set hiragana (pressed without shift) and katakana (pressed with shift) input modes.

I use the 「カタカナ/ひらがな」 key pretty frequently using Fcitx 4, but it is not working for me using Fcitx 5! The keyboard configuration looks fine, and I confirmed that the key is working using showkey. Mozc is configured to use the “MS-IME” keymap style, and I have tried using a custom keymap as well.

Author

Travis Cardwell

Published

Revised

Tags
Related Blog Entries