How to enable Chinese input using on-screen keyboard in Ubuntu 18.04

Solution 1:

After having switched to Intelligent Pinyin (provided by the ibus-libpinyin package) and enabled GNOME's On Screen Keyboard it worked instantly for me. Since I don't have a touch screen, I used the mouse to click the virtual keys. Clicking b e i j i n g results in 北京.

This works both on Ubuntu 21.04 (which I'm currently using) and Ubuntu 18.04 in VM.

Most likely it doesn't work on Ubuntu with GNOME if you use some Fcitx input source.