Google Summer of Code, Porting Keyboard KCM to Qt Quick — Part 2
Hi! It’s been quite a while since the first blog post. I’ve been working on the new redesign of the Keyboard KCM, and in this post I’m going to show you the progress I’ve made so far.
Since last time, I’ve been mainly focusing on working improving the infrastructure. One of the goals of this project was to make configuring the input methods (like fcitx, ibus, …) in the System Settings easier. I decided to start with fcitx, since we know the developer of it (Xuetian Weng), and thus easier to ask when there is a question/problem.
I made the KCM detect the presence of fcitx on the system and show the user an updated list of options with fcitx in mind. Then, if somehow fcitx goes away, it falls back to xkb (on X11) and shows you that some of the IMs have gone missing.
And then, to incorporate this UI change to actual functionality, the keybinding for used for switching the xkb layouts now switches between fcitx’ layouts whenever fcitx is enabled. This is done on the Kded (KDE Daemon) part of the KCM.
One of the problems for doing this is that many CJK (Chinese, Japanese, and Korean) users need to frequently switch to typing Latin while typing in their language. Weng, the developer of fcitx said, fcitx allows this by assigning a special meaning to the first keyboard layout configured in their layout list, and when the user presses a designated switch key, the keyboard switches to that first layout. However, we think this method is overcomplicated and because our goal is to make users’ lives easier, I decided to make this model a bit simpler, by abstracting fcitx’ model away behind the kded module. At the moment, the model I’m thinking of is to add a “Keyboard Layout to use while in Latin Mode” option to the Configure dialog that pops up when the user clicks on the configure button for each IM on the list, and then add another shortcut to switch between the Latin mode and the IM’s mode.
Fortunately, Weng says, a better model is coming up on the new release of fcitx5! But for now, we are stuck with fcitx4, and have to deal with its issues the way I described above.
On another note, last time, Alexander Browne mentioned that the settings in the Advanced section is important and should not be removed. I fully agree, and I’m thinking of moving those options to each layout’s specific settings. Many of the options don’t make sense to be a layout-universal settings anyway. This will allow more flexibility for each layout, and switching will make more sense.
To finish off, I’ll talk about the code that was deleted. The legacy tray icon indicator is removed from the daemon code now, and will be replaced by a plasmoid-based indicator icon.