implement an emit command and resolve #4937

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
This commit is contained in:
Tert0 2024-12-11 22:00:39 +01:00
parent f293418d9d
commit 8689627774
No known key found for this signature in database
GPG key ID: 5CD17B02E0EFD576
7 changed files with 181 additions and 6 deletions

View file

@ -201,6 +201,7 @@ sway_cmd cmd_workspace;
sway_cmd cmd_workspace_layout;
sway_cmd cmd_ws_auto_back_and_forth;
sway_cmd cmd_xwayland;
sway_cmd cmd_emit;
sway_cmd bar_cmd_bindcode;
sway_cmd bar_cmd_binding_mode_indicator;

View file

@ -61,4 +61,6 @@ const char *sway_wl_output_subpixel_to_string(enum wl_output_subpixel subpixel);
bool sway_set_cloexec(int fd, bool cloexec);
uint32_t get_current_time_msec(void);
#endif