-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 an emit command (#4937) #8497
base: master
Are you sure you want to change the base?
Conversation
Command Syntax: emit <press|release|press-release> <criteria> <keys> * action: specifies whether to press, release the keys or do both * criteria: first window that matches the criteria will get the key input * keys: modifiers and keys separated by + Examples: * emit press-release [app_id=com.obsproject.Studio] ALT+F8 * bindsym --no-repeat Ctrl+T emit press [app_id=wev] Ctrl+A * bindsym --no-repeat --release Ctrl+T emit release [app_id=wev] Ctrl+A
Now that we have Wayland protocols for this feature, I'm not sure adding IPC commands is really desirable… |
Which wayland protocols are you referring to? |
virtual-keyboard and virtual-pointer. |
As far as I understand the virtual-keyboard protocol, it does not allow sending keys to unfocused windows. This would be a useful feature to "emulate" global hotkeys for applications. |
A Wayland surface must by definition have keyboard focus to receive key events. This is what enter/leave is. The proposed command gives keyboard focus to the window matching the criteria (which is the bit "missing" from virtual-keyboard) and then issues a single synthetic key event. Unless all key events are sent at once, this would race with the keyboard state of the window the user currently focused and any keyboard inputs they are typing. |
Using
Is there a way with wlroots to send all key events at once? |
Closes #4937
Command Syntax:
emit <press|release|press-release> <criteria> <keys>
Parameters
Examples
emit press-release [app_id=com.obsproject.Studio] ALT+F8
bindsym --no-repeat Ctrl+T emit press [app_id=wev] Ctrl+A
bindsym --no-repeat --release Ctrl+T emit release [app_id=wev] Ctrl+A
Test
wev -f wl_keyboard
with a terminalwev
window into another workspace-> The terminal running
wev
should show that Ctrl+A was pressed-> The terminal running
wev
should show that Ctrl+A was releasedCode Structure
I am not sure if I should move the code (for converting xkb keysym to key codes), that I copied from the
sway/commands/bind.c
, tocommon/utils.c
or maybe somewhere else.