익명 18:49

Super + space can't switch keyboard layouts when hiragana is active

Super + space can't switch keyboard layouts when hiragana is active

I am using Ubuntu 24.04 with English and Japanese keyboards: gsettings get org.gnome.desktop.input-sources sources gives [('xkb', 'us'), ('ibus', 'mozc-jp')].

The Japanese layout can input roman letters (capital A sign is in top-right corner of the screen); or hiragana (hiragana あ is displayed in top-right corner).

The problem is, that while I can reliably switch with super + space from English to Japanese, I can only switch back, if the Japanese layout is set to roman letters. Switching back from hiragana to English occasionally might work, but usually does not.

In a terminal screen, having hiragana active, the combination super+space almost always results in a space (that is: as if the super key were ignored completely).

I might have read somewhere that "this has to do something with 2-byte character encoding", but I can't seem to find the source right now. This was not an issue prior with Ubuntu 22.04.



Top Answer/Comment:

On my laptop, not only Win+Space (switch languages) didn't work, but the other Win key combinations like Win+L (lock) didn't work too.

I managed to solve the issue by adding the following line to /etc/environment:

GTK_IM_MODULE=ibus

I had to restart to see the effect.

I don't know about the full consequences of this change, but it didn't cause any problems for me.


For what it's worth, Arch linux wiki recommends adding two more variables to the same file:

QT_IM_MODULE=ibus
XMODIFIERS=@im=ibus

These are not required to fix the problem in question, but it may be a good idea to add them to prevent similar bugs.

상단 광고의 [X] 버튼을 누르면 내용이 보입니다