Lately I’ve been learning Japanese language and one of the early question that I have in mind was “how do Japanese people type digitally?”
If you’re not familiar, Japanese have 3 type of characters (Hiragana, Katakana, Kanji) but they still use Latin alphabet sometimes, for example when typing English word or abbreviations that doesn’t have a Japanese equivalent
At first, I thought maybe they had a special keyboard or constantly switching between input methods, since I noticed many Japanese keyboards have Hiragana character printed on the keys
It’s kinda right, but what I didn’t know was that there’s something called IME (Input Method Editor) which is a system layer that sits between keyboard input and application you’re typing into and its job is to transform whatever you type into the desired character while also maintaining other possible interpretations as you go forward
And that’s is really cool, so you don’t need a special keyboard at all, just make sure you use the correct language and IME will handle the rest. On Linux, the flow looks roughly like this:
Hardware Keyboard (Qwerty) → X11/Wayland → IBus (or Fcitx) → IME Engine (Mozc / Anthy) → Application
And if the Application layer is happen to be a browser, there’s even a set of JavaScript events fired during IME usage, namely: compositionstart, compositionupdate, compositionend
It’s getting more and more interesting the more you go down the rabbithole, my whole life I’ve been using Latin alphabet, so I’m ignorant to all of this and this a new thing to me
A reminder that we can always learn something new from other cultures, I probably would’ve never discovered about IME if I hadn’t started learning Japanese
This post is getting too long, have a nice day!