termux / termux-packages

A package build system for Termux.
https://termux.dev
Other
13.33k stars 3.06k forks source link

[Question] How to change USB keyboard language through fcitx5 #19717

Closed hansm629 closed 7 months ago

hansm629 commented 7 months ago

I installed all fcitx5 related packages from Termux main-repo.

The main purpose is to switch between Korean and English using Ctrl+Space or the right Alt key on the USB keyboard through fcitx5 in DeX mode.

However, it seems that fcitx5 does not work after installation.

Even if you apply the fcitx5 configuration method in general Linux, Keyboard language switching does not work.

Is there a manual for getting fcitx5 to work in a Termux native environment?

Screenshot_2024-04-09_21-47-08 Screenshot_2024-04-09_21-47-54

twaik commented 7 months ago

Control + space may be consumed by Android. Did you enable "Prefer scancodes" preference of Termux:X11?

hansm629 commented 7 months ago

@twaik Yes, it is set. fcitx(or fcitx5) works well on PRoot Debian Linux.

Screenshot_20240409_220401_TermuxX11

Are there any separate environment variables that need to be set in the Termux native environment?

When I used fcitx on PRoot Debian Linux After using the settings as shown below and running fcitx every time I log in in the XFCE session settings, language switching worked well.

$ sudo nano ~/.profile
export QT_IM_MODULE=fcitx
export GTK_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx
export DefaultIMModule=fcitx

#optional
fcitx-autostart &>/dev/null

The above method does not seem to work in Termux native.

Is there a way?

twaik commented 7 months ago

Closing in prior to #19775.