Fcitx 5 first release is in 2020/11/2, and as of today, we have reached the 13th release of Fcitx 5.
What happened to Fcitx 5 within this whole year of development?
1. Best Wayland support on Linux
As of today, to my knowledge, Fcitx 5 is the only input method frameworks under Linux that works under all different types of wayland.
We have been testing KDE/GNOME/Sway (Only causally played with wayfire and since there are too many wlroots based around we can’t do much test there.).
2. New engines
By the end of year we have two new engines https://keyman.com/ and https://github.com/OpenBangla/OpenBangla-Keyboard .
3. Flatpak support
Not only flatpak support fcitx5, but fcitx5 also works as a flatpak package.
4. New features comparing to Fcitx 4 counterparts.
We really got tons of them new features, e.g.
fully customizable shuangpin profile (you can define shuangpin profile with any combinitions of initial/final
new preedit mode that takes less space in input window
punctuation configuration via GUI
quick match for long word in Pinyin
paritial shuangpin support
rime plugin loading
rime new preedit mode
rime dbus API
rime app_options
…
5. Android support
I didn’t develop this, only provides some Q/A on the details, and add some support to make it build/work on android more easily. https://github.com/rocka/fcitx5-android-poc/ It’s still considered as highly experimental, please use it with caution. One of our next target is to come up with a new API for implementing virtual keyboard, which will also benefit the native linux on screen keyboard.
If you are still using Fcitx 4, please consider give Fcitx 5 a try. You can find the distribution that packages fcitx5 via https://pkgs.org/search/?q=fcitx5 .
This is mainly a complain about how mess this feature is and why no one could reliably use it.
To give people some background, surrounding text is about the feature that an application can notify the input method what are the characters around the cursor, and the input method can directly change the text around the cursor.
For example, in a input box, you have some text like this.
For example, in this case, the input method will receive text is “I like typing.”, the anchor is 8, and the cursor is 10. Anchor is the starting offset of the selection, and the cursor is the end of selection. If there is no selection, anchor will equal to cursor.
Now you may want to ask, isn’t it a costly thing to do? Answer is YES. Imagine you have a crazy long line in the editor, and whenever you change the text, you will need to send it over to the input method. Usually, input method would just apply a maximum size.
Next we will need to talk about the messiest thing about this is the API. Here lets list things about what are people doing with it.
Gtk native API: set_surrounding_text / delete_surrounding_text, the value of offset is Unicode(UCS4) character based. delete_surrounding_text uses (offset, length) to define the range.
Qt native API: the value of offset is UTF-16 character based. delete_surrounding_text uses (offset, length) to define the range, but, it excludes the current selected text when applying offset and length.
Wayland protocol text-input-v1 / zwp_input_method_v1, similar to Qt, but offsets are UTF-8 character based.
Wayland protocol text-input-v2 / text-input-v3 / zwp_input_method_v2 , delete_surrounding_text uses (before, after) to described the range. Basically it means some additional character before and after the selection. Offsets are also utf8 character based.
Gtk implementation of text-input-v3 (?!), does not follow (4), by just using received UTF-8 offset as Unicode (UCS4) based offset, which is actually a bug. Also, it does not actively sending over the update of surrounding text, which makes it useless.
Also, people seems to not have a clear definition about whether surrounding text should include preedit text. Which is purely headache to deal with.
Not to mention that non-native widget implemented with Gtk/Qt are very likely to implement it in a wrong way. Also XIM does not support it. Not to mention that terminal application that does not support it have to claim it support surrounding text, due to lacking of ability to notify application.
So now, people are more likely to stick to use a limited set of feature in surrounding text.
Use it as auxiliary data like primary selection, to just learn about what text is being selected.
Delete surrounding text only when it is extremely reliable, e.g. delete 1 cursor before cursor.
When implementing a feature that requires full featured surrounding text, make this feature optional and always provides an alternative easy way for user to not using it.
When Fcitx read the layout information, it read from xkeyboard-config, mostly like to be /usr/share/X11/xkb/rules/evdev.xml on your system. But unfortunately, there might be missing data in this file and you should report the bug to bugs.freedesktop.org for missing data.
But what if you want to use the layout right now without waiting for the bugfix for xkeyboard-config?
Here’s an easy way to do it at user level.
For example, if you use setxkbmap -layout br -variant abnt2 to setup your keyboard input method, but you find this entry is not currently in evdev.xml files, then you can do:
1. Create a configuration for input method Pleasse notice, the file name matters, it should be named by keyboard-[layout]-[variant].conf The file name for this layout should be ~/.local/share/fcitx5/inputmethod/keyboard-br-abnt2.conf
The “Name=” section in the file doesn’t really matter, you can put anything meaningful to you. LangCode= and Label= also doesn’t really matter.
2. Restart fcitx 5 to make it reload the data.
3. Open config tool to add it to the list.
4. Move it to the first place in the list, and you will get a popup that ask you: whether you want to fix the config to make the system layout configuration matches the first input method. You may click yes to set it. Because evdev.xml does not have the corresponding entry, you’ll not be able configure the system layout the regular way.
Then you should be able to use the layout just like using the setxkbmap command, enjoy!
界面框架大小不提,字看不清那是最难受的,因此只调整字体大小这样的设置,成为了大部分人解决问题的第一步。但是,在 X 上,这个设置是全局的,因此也就不能针对不同的屏幕,来设置一个统一的 DPI。一个屏幕大一个屏幕小也可以说是常态了,不少人就选择设置一个居中的值来自己适应。毕竟人是活的,程序是死的,改变不了世界那就只好自己适应世界。
也许有人说,显示器不都可以配置分辨率么?你3200×1800的屏幕,我强行设置 1600×900 不就完全正常大小了么?这样说当然是没有问题,但是相对的你也就没有利用上这个屏幕的资源,原本你可以在更高的像素点上进行更好的反锯齿。相当于说,你把大图片缩小再放大,你得到的能是原始图片的效果么?必然是有数据损失的。当然,还是那句话,人是活的,程序是死的。一句 I don’t care 什么问题都能解决。