diff options
author | Tony Crisci <tony@dubstepdish.com> | 2018-01-05 07:00:50 -0500 |
---|---|---|
committer | Tony Crisci <tony@dubstepdish.com> | 2018-01-05 07:00:50 -0500 |
commit | 0ef2df21f2943c3985fcc86f5f6c3289036be491 (patch) | |
tree | 600c5651159a12b85632cf72eb3e7c4b863a68f0 /include | |
parent | c8b9c0ad0e8155a04f3192b75c5bcd64597fbc16 (diff) |
compositor modifier hook
Diffstat (limited to 'include')
-rw-r--r-- | include/wlr/types/wlr_keyboard.h | 14 | ||||
-rw-r--r-- | include/wlr/types/wlr_seat.h | 14 |
2 files changed, 19 insertions, 9 deletions
diff --git a/include/wlr/types/wlr_keyboard.h b/include/wlr/types/wlr_keyboard.h index d32d6e96..b37797c8 100644 --- a/include/wlr/types/wlr_keyboard.h +++ b/include/wlr/types/wlr_keyboard.h @@ -32,6 +32,13 @@ enum wlr_keyboard_modifier { struct wlr_keyboard_impl; +struct wlr_keyboard_modifiers { + xkb_mod_mask_t depressed; + xkb_mod_mask_t latched; + xkb_mod_mask_t locked; + xkb_mod_mask_t group; +}; + struct wlr_keyboard { struct wlr_keyboard_impl *impl; // TODO: Should this store key repeat info too? @@ -45,12 +52,7 @@ struct wlr_keyboard { uint32_t keycodes[WLR_KEYBOARD_KEYS_CAP]; size_t num_keycodes; - struct { - xkb_mod_mask_t depressed; - xkb_mod_mask_t latched; - xkb_mod_mask_t locked; - xkb_mod_mask_t group; - } modifiers; + struct wlr_keyboard_modifiers *modifiers; struct { int32_t rate; diff --git a/include/wlr/types/wlr_seat.h b/include/wlr/types/wlr_seat.h index 432e5dc3..f5b4afde 100644 --- a/include/wlr/types/wlr_seat.h +++ b/include/wlr/types/wlr_seat.h @@ -71,7 +71,8 @@ struct wlr_keyboard_grab_interface { struct wlr_surface *surface); void (*key)(struct wlr_seat_keyboard_grab *grab, uint32_t time, uint32_t key, uint32_t state); - void (*modifiers)(struct wlr_seat_keyboard_grab *grab); + void (*modifiers)(struct wlr_seat_keyboard_grab *grab, + struct wlr_keyboard_modifiers *modifiers); void (*cancel)(struct wlr_seat_keyboard_grab *grab); }; @@ -345,6 +346,11 @@ bool wlr_seat_pointer_has_grab(struct wlr_seat *seat); void wlr_seat_set_keyboard(struct wlr_seat *seat, struct wlr_input_device *dev); /** + * Get the active keyboard for the seat. + */ +struct wlr_keyboard *wlr_seat_get_keyboard(struct wlr_seat *seat); + +/** * Start a grab of the keyboard of this seat. The grabber is responsible for * handling all keyboard events until the grab ends. */ @@ -375,13 +381,15 @@ void wlr_seat_keyboard_notify_key(struct wlr_seat *seat, uint32_t time, * Send the modifier state to focused keyboard resources. Compositors should use * `wlr_seat_keyboard_notify_modifiers()` to respect any keyboard grabs. */ -void wlr_seat_keyboard_send_modifiers(struct wlr_seat *seat); +void wlr_seat_keyboard_send_modifiers(struct wlr_seat *seat, + struct wlr_keyboard_modifiers *modifiers); /** * Notify the seat that the modifiers for the keyboard have changed. Defers to * any keyboard grabs. */ -void wlr_seat_keyboard_notify_modifiers(struct wlr_seat *seat); +void wlr_seat_keyboard_notify_modifiers(struct wlr_seat *seat, + struct wlr_keyboard_modifiers *modifiers); /** * Notify the seat that the keyboard focus has changed and request it to be the |