Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Wayland xcb layout options #712

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

danielzgtg
Copy link

@danielzgtg danielzgtg commented Feb 5, 2023

Closes #705.

This feature allows uses to have fcitx5 manage their KDE Wayland XKB layout options when switching groups.

Missing things

  • X11 is not implemented as it is more complicated
  • Migration from kxkbrc is not implemented, and users may be shocked that their layout options are reset when they update fcitx, and be confused until they find this feature
  • Need to test whether the new field is lost or not with kde-config-fcitx5

Before

I wanted to have a French Dvorak layout to type accents with RALT/AltGr level3, and a Japanese Kana layout with RALT mapped to Henkan.

I could have fcitx5 have one of them working automatically when switching between them. I had to change the "3rd level shortcuts" in "KDE System Settings > Input Devices > Keyboards > Layouts." When level3 was enabled, the French worked but the Japanese didn't as the level3 option overrode my custom definition of RALT as Henkan. When level3 was disabled, the French obviously didn't work as it was not enabled, but my custom Japanese RALT Henkan worked as the level3 options was no longer overriding it.

After

I put Default Layout Options=lv3:ralt_switch_multikey in my French group in ~/.config/fcitx5/profile, and Default Layout Options= in my Japanese group. Now fcitx5 automatically controls my xcb keyboard layout so I can switch between languages conveniently.

@danielzgtg danielzgtg marked this pull request as draft February 6, 2023 05:19
@wengxt
Copy link
Member

wengxt commented Feb 10, 2023

This is a behavior change. So I like to see an global option like "use system xkb option".

Actually, with this change, you may rename this option to "use system xkb option" https://github.com/fcitx/fcitx5/blob/master/src/lib/fcitx/globalconfig.cpp#L162 and remove this option: https://github.com/fcitx/fcitx5/blob/master/src/lib/fcitx/globalconfig.cpp#L173

Also, will you also work on expose this in the UI?

https://github.com/fcitx/fcitx5-configtool/

You may need to update

inputMethodGroupInfo(const std::string &groupName) {
too to allow this new setting to be sent over the dbus.

@danielzgtg
Copy link
Author

Thank you for the feedback. I will make sure to have that global option in the final version.

The last thing I was doing was reading the code. Before that I was installing the dev packages to get fcitx5-configtool to finally build. I need to fix a few strange problems of things randomly changing, and I need to understand the project to do that. I think this will take around 1 month, as I have university. Nobody else who might require this feature voted on GitHub, so I think timing shouldn't be a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Manage xkb options in addition to layout and variant
2 participants