Page 1 of 1

Cannot Use Chinese Input on Qpdfview (or All Qt Apps?)

Posted: Wed Sep 22, 2021 4:58 am
by miltonx

I tried fcitix and yong (20.0.0s and 18.0.51) on fossapup64_95. They work pretty well most of the time, but I found they cannot be activated on Qpdfview. To test this, try opening a pdf file on qpdfview, click any input area on the tool bar, or press ctrl+f to bring up the text search tool. Fcitx and Yong do not work on these input boxes.

So far I have not tried scim and ibus.

I also did a similar test on Debian 10.6, installed fcitx and qpdfview from Debian's official repo. Fcitx is able to input Chinese in Qpdfview's text search box.


Re: Cannot Use Chinese Input on Qpdfview

Posted: Wed Sep 22, 2021 8:43 am
by icake

Thanks for sharing your experience with the Chinese input on fossapup64_9.5.

Because linux systems and applications are put together without any test on whether they can fully support Chinese. Therefore the Chinese pets will work on most but not all applications.

I have limited experience with the fossapup64_9.5 system and knows nothing about qpdfview. I wonder if any other forum members who are more familiar with fossapup64_9.5 and qpdfview can help on this issue?

icake


Re: Cannot Use Chinese Input on Qpdfview (or All Qt Apps?)

Posted: Wed Sep 22, 2021 12:37 pm
by miltonx

Further testing of Yong showed same problem with QtNote. Seems that Yong does not work well with Qt apps?
(Haven't tested fcitx.)


Re: Cannot Use Chinese Input on Qpdfview (or All Qt Apps?)

Posted: Wed Sep 22, 2021 1:15 pm
by miltonx

I did some googling and found a post from Yong's website:
http://yong.dgod.net/read.php?tid=1987
(This site is often inaccessible. When that happens, I resort to google's cache page. Try googling "小小输入法 QT" and you will see that page.)
Reading dgod's posts, I confirmed that there is problem with QT.
Following his advice, I downloaded the qt lib file from:
http://yongim.ys168.com/
In the QT5 directory.
I downloaded libyongplatforminputcontextplugin.so (38.8KB5.5.1 64) and put it in /usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/.
(There are different QT versions for this file - libyongplatforminputcontextplugin.so, but I only tried this one.)
Then open a terminal, run:

Code: Select all

export GTK_IM_MODULE=yong
export QT_IM_MODULE=yong

Please note that this is different from what icake inserted in .xinitrc

Code: Select all

export GTK_XIM_MODULES="yong"
export QT_XIM_MODULES="yong"

I don't understand the difference between XIM and IM. Will research it later.
Then, keep this terminal open, and run a QT program from that same terminal (so that these exported environment variables are inherited), such as "qtnote", and Yong works. I also tested it for qpdfview.
At this moment I have not tried modifying the .xinitrc file to automatically export these variables on startup, because I can't wait to read some linux input method stuff, which is a huge pain in the ass and something irresistable for me to learn.


Re: Cannot Use Chinese Input on Qpdfview (or All Qt Apps?)

Posted: Wed Sep 22, 2021 1:48 pm
by miltonx

OK, did it in .xinitrc:
Make your .xinitrc's input method variables part look like this:

Code: Select all

...
	export  XIM="yong"
	export  XIM_ARGS="-d"
	export  XIM_PROGRAM="yong"
	export GTK_XIM_MODULES="yong"
	export QT_XIM_MODULES="yong"   (Maybe this line is not needed, but I didn't test.)
	#export GTK_IM_MODULE="yong"  (Comment out or delete this line, otherwise you will not be able to input in GTK programs)
	export QT_IM_MODULE="yong"      (This line is the key to make yong work on QT programs)
	eval `dbus-launch --sh-syntax --exit-with-session`
	export XMODIFIERS="@im=yong"
	export LC_CTYPE="zh_CN.utf8"
	sleep 5
	yong &
...

In effect, this is just one line added to icake's insersion, ie, export QT_IM_MODULE="yong".


Solved: Cannot Use Chinese Input on Qpdfview (or All Qt Apps?)

Posted: Thu Sep 23, 2021 12:15 pm
by icake

Thanks for sharing.