diff options
author | dec05eba <dec05eba@protonmail.com> | 2025-01-04 05:39:16 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2025-01-04 05:39:16 +0100 |
commit | 52ce22ae22670b11c2bc5fac0583e1a4aa4e19f0 (patch) | |
tree | 67c6e6a02c567b45252074e2672bde6bc9ffde6f /tools/gsr-global-hotkeys/keyboard_event.h | |
parent | f379b87b33282a7d583ce5e57be684a718f6a68d (diff) |
Add option to only grab virtual devices, to support input remapping software
Diffstat (limited to 'tools/gsr-global-hotkeys/keyboard_event.h')
-rw-r--r-- | tools/gsr-global-hotkeys/keyboard_event.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/gsr-global-hotkeys/keyboard_event.h b/tools/gsr-global-hotkeys/keyboard_event.h index d12b684..5310aca 100644 --- a/tools/gsr-global-hotkeys/keyboard_event.h +++ b/tools/gsr-global-hotkeys/keyboard_event.h @@ -36,6 +36,11 @@ typedef struct { int num_keys_pressed; } event_extra_data; +typedef enum { + KEYBOARD_GRAB_TYPE_ALL, + KEYBOARD_GRAB_TYPE_VIRTUAL +} keyboard_grab_type; + typedef struct { struct pollfd event_polls[MAX_EVENT_POLLS]; /* Current size is |num_event_polls| */ event_extra_data event_extra_data[MAX_EVENT_POLLS]; /* Current size is |num_event_polls| */ @@ -45,6 +50,7 @@ typedef struct { int hotplug_event_index; int uinput_fd; bool stdout_failed; + keyboard_grab_type grab_type; hotplug_event hotplug_ev; @@ -62,7 +68,7 @@ typedef struct { /* Return true to allow other applications to receive the key input (when using exclusive grab) */ typedef bool (*key_callback)(uint32_t key, uint32_t modifiers, int press_status, void *userdata); -bool keyboard_event_init(keyboard_event *self, bool poll_stdout_error, bool exclusive_grab); +bool keyboard_event_init(keyboard_event *self, bool poll_stdout_error, bool exclusive_grab, keyboard_grab_type grab_type); void keyboard_event_deinit(keyboard_event *self); /* If |timeout_milliseconds| is -1 then wait until an event is received */ |