1: posts
Reading ModeRO
$ cat 20190728_oyainput.md

#Setting up Japanese thumb-shift input on Ubuntu 18.04 LTS

Date:2019-07-28 (Sun)
>Configuring oyainput and Fcitx with Mozc for Japanese thumb-shift typing and starting the input tool at login.

I’ve been using thumb-shift typing for six or seven years.
Here’s how I set it up on Ubuntu 18.04 LTS.

##In this article

  • Build a finger shift environment with high conversion performance for Ubuntu 18.04 LTS.

##What is thumb-shift typing?

Thumb shift is a fast typing system designed specifically for Japanese.
Pressing two keys together lets you enter any hiragana in a single stroke, including kana with voiced and semi-voiced marks.
The layout is based on how often each kana appeared in a large sample of Japanese writing.
The most common characters sit close to the home position.

People often mention speed. What matters most to me is how little fatigue builds up during a long typing session.
I’ve had stiff shoulders for years, and mine bothered me noticeably less after I switched from romaji input.

This introduction goes into more detail about thumb-shift typing:

##Installing and configuring oyainput

The layout was designed for a dedicated keyboard. Those keyboards are uncommon now, so people often emulate the layout in software. Some physical keyboards suit it better than others.
On Windows, Yamabuki R is a popular option. On Linux I use oyainput.
It works with Mozc, the open-source counterpart to Google Japanese Input.
For me, combining thumb shift with Mozc makes typing Japanese much more efficient.

  1. Get the source code for oyainput
    Run the following command to obtain the source code of oyainput.
Bash
git clone https://github.com/inwskatsube/oyainput
  1. Build and install the source code
    Run the following command to build and install the source code.
Bash
cd oyainput
make
sudo make install
  1. Run oyainput once
    Run the following command to start oyainput.
    At this point, if two or more keyboards are detected, the options will be displayed.
    If you don't know which one to choose, it's easiest to just pick one randomly and check the operation.
    If it starts up normally, use ctrl+c to stop it.
Bash
oyainput
  1. Open the .oyainputconf file generated in the home directory and change the settings.
    It's best to set it according to your own environment, but I'm setting it up as follows.
# Keyboard name (ASUS UX331UN here; use the name you selected above)
KEYBOARDNAME=AT Translated Set 2 keyboard

# Left thumb key
LOYAKEY=MUHENKAN

# Right thumb key
ROYAKEY=HENKAN

Now that the settings are configured, restart oyainput to verify the functionality.
Japanese input worked for me, but English input still behaved as if thumb shift were active: pressing S produced si.
This point will be fixed later.

##Changing the input method framework

As mentioned above, this issue seems to occur when using ibus as the input IM.
We don't really understand the detailed cause itself (is the implementation simply not supporting it?).
Since ibus is used by default in Ubuntu 18.04LTS, change it to fcitx.

  1. Install fcitx-mozc
    Install via the following command:
Bash
sudo apt install fcitx-mozc
  1. Change IM to fcitx and reboot the PC
    Open the 'Show Applications' button in the bottom left corner of the screen, and enter 'Language Support' in the search box to open it.
    Then, change the IM system used for input on the keyboard to fcitx.
    After making the changes, I rebooted the PC.

  2. Change the settings for oyainput
    Open .oyainputconf again and change it as follows.

# Input method whose on/off state to follow: fcitx, ibus, auto, or none.
IM=fcitx

Start the oyainput to test it after making changes.
If you can input English text normally, that's okay.

##Starting oyainput at login

Set to automatically launch oyainput when the PC starts (strictly speaking, when logging in).
First, open the Show applications button in the bottom left corner of the screen, search for session, and open the Set up automatically launching applications settings.

Display the application's screen

The following screen opens.

Screen showing the settings for applications to start automatically

Click 追加 and input as follows.

Add settings for oyainput

Enter the input and press "Add" to save it.
It should look like this after adding it successfully.

Screen after addition

Reboot and try typing with thumb shift after login. If it works, the startup entry is doing its job.
By the way, pressing the pause button can temporarily stop oyainput.

##Wrapping up

That gives me a working thumb-shift setup.
It would be good if it actually works withibus, but I would like to update it as soon as I understand the cause (in fact, if anyone knows a solution, I would like to know it).

I’m still very fond of this way of typing.
I rarely meet other thumb-shift users, perhaps because it takes time to learn.
When I learned, I stopped using romaji input altogether. After about a month I could type reasonably well. I was a student then; that approach would be harder with a day job.
If I get the chance, I’d like to write about how I practiced.

## Comments

"20190728_oyainput.md" [readonly]2L, 5530B
utf-8100%