-
-
Notifications
You must be signed in to change notification settings - Fork 70
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
Input emulation via libei #343
Comments
I never really understood why we need a library for this, but if someone wants to implement a libei backend and help to maintain it, I'll probably accept it. It would be best to load libei using |
Out of curiosity, do you think that libei would be a better solution than to have wayland protocols for virtual input? What makes it better? Does there exist a requirement for this that cannot be satisfied with a plain wayland protocols? |
The problem with the existing protocols is that their interactions are not properly specified. If a client uses a virtual keyboard to inject events, does it also receive those events via wl_keyboard if it has the focus? If a client uses virtual keyboard to inject events, does it also receive those events via input-method if it has created an input method? libei sits in the same layer as libinput which makes it clear that events take the same route as libinput events. |
If these interactions were to be properly specified, is there anything else that disqualifies the protocol approach? I think that a virtual keyboard should inject events at the same level as libinput within the compositor. It's probably easier to implement that way. |
Sure, if you specified it from the start, it should work.
fcitx requires that the virtual keyboard bypasses input-method clients. |
To be totally honest, I've never touched anything related to input method and for the longest time I didn't even know what it was for or why it existed. If you type something on a regular keyboard, does that normally produce input method events for input method clients? |
Input flows as follows when an input method is active:
|
Can you make a recommendation on how to specify IM interaction for ext-virtual-keyboard-v1? |
If you want a protocol that acts at the libinput level, you first have to solve the usecase that fcitx currently uses the virtual keyboard protocol for. For example by adding methods to the input method protocol to send raw keyboard input directly to the client, bypassing the normal input pipeline. If you want such a protocol to support client-defined keymaps, you also have to address https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/406 since otherwise there is no way to switch between keymaps without temporarily removing keyboard focus. |
Come to think of it, it simplifies a lot of things to specify that the virtual keyboard must have exclusive state. This would place it at a different level, right? I'm also fine with virtual keyboards being at a different level than physical keyboards. I'll comment on this over on the MR.
Does this affect the design of the virtual keyboard protocol? |
I don't know what you mean by exclusive state.
If you want the protocol to support custom keymaps. libei doesn't allow clients to set custom keymaps so this issue doesn't exist there. |
I mean that the state of the virtual keyboard does not affect other keyboards, be they physical or virtual, and vice versa.
Sorry, I actually wanted to know how it affects the design. ;) |
libei should provide most of the functionality needed. The primary difference is that libei does not allow the client to set a keymap.
One problem is that there is currently no way to map libei regions to wl_outputs for absolute pointer movements. I have opened https://gitlab.freedesktop.org/libinput/libei/-/issues/65 for this.
Is this something you are interested in?
The text was updated successfully, but these errors were encountered: