-
Notifications
You must be signed in to change notification settings - Fork 29
Add wlr-keyboard-modifiers-unstable protocol #31
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
I think I'm still -1 on this protocol tbh. |
Do you have any suggestions to improve it? |
I'd just like to add my support for this as a user. I constantly switch between three languages that require distinct layouts, and it's super helpful to have my status bar display the current one. I get that this protocol might seem too specific, but I feel like it addresses an important point. Thanks @harishkrupo for putting in the work for this, and @emersion and @ddevault for giving feedback and guidance! |
As a DE dev, I would also like to vouch for the usefulness of this protocol. |
the protocol should probably be extended to get all the configured layouts (so that you can have a pop-up menu with all the layouts), and also to switch to another layout. |
afaict this protocol does not fulfill this use-case. But you can fulfill this use-case anyway by just listening for keymaps on |
@ddevault, Does wl_seat advertise keymaps? I don't see any event for that here: https://gitlab.freedesktop.org/wayland/wayland/blob/master/protocol/wayland.xml#L1663 |
I think that this protocol needs to be extended to be also able to switch the current layout (and possibly enumerate all layouts, if there is no other way to do that). |
No, because when you switch the layout, the keymap doesn't change (it contains multiple layouts). Instead, the modifiers change. We do send modifiers, but only to the currently keyboard-focused surface. So bars aren't notified.
See
Is it possible at all to programatically switch layouts using the libxkbcommon API? EDIT: seems like it, since you know the number of layouts and you can set modifiers. Enumerating all layouts is possible client-side using the libxkbcommon API. It gives names like Oh, and this protocol should include a |
xkbcommon/libxkbcommon#22 |
All right. In any case, it doesn't belong to this protocol, and should be done client-side. |
Does the xkb state sent by the compositor also contain the list of enabled layouts? |
Yes. |
Extending this a bit: what if a client (bar or shell) wants to listen to e.g. KEY_VOLUMEDOWN, KEY_VOLUMEUP or KEY_POWER. If we want to allow clients to handle this we might need a protocol to send certain input events to special clients (maybe using a whitelist in the compositor so clients can request certain input events but only get access to them if whitelisted). |
Related: https://patchwork.freedesktop.org/patch/172113/ Note that in sway, we handle this by running commands instead of having some kind of "keybind protocol". |
This patch adds a new module to show the current keyboard layout. Signed-off-by: Harish Krupo <harishkrupo@gmail.com>
|
||
<request name="get_wlr_keyboard"> | ||
<description summary="Create a wrapper over wl_keyboard"> | ||
Retruns a wrapper for the wl_keyboard passed as an argument. The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Retruns a wrapper for the wl_keyboard passed as an argument. The | |
Returns a wrapper for the wl_keyboard passed as an argument. The |
wlr-protocols has migrated to gitlab.freedesktop.org. This pull request has been moved to: https://gitlab.freedesktop.org/wlroots/wlr-protocols/-/merge_requests/31 |
Signed-off-by: Harish Krupo harish.krupo.kps@intel.com