diff options
author | Tony Crisci <tony@dubstepdish.com> | 2017-09-22 16:07:00 -0400 |
---|---|---|
committer | Tony Crisci <tony@dubstepdish.com> | 2017-09-22 16:28:11 -0400 |
commit | cef1f60522141f3e1a4fe5278d89bb77118735d4 (patch) | |
tree | 72ae0aa7b037fa35f4fb035ce444023c00154e0f /include/wlr | |
parent | 06ae9e7c9f8811dcda3df8ec72ab75e54ee54b87 (diff) |
wlr-seat-keyboard: basic events
Diffstat (limited to 'include/wlr')
-rw-r--r-- | include/wlr/types/wlr_seat.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/include/wlr/types/wlr_seat.h b/include/wlr/types/wlr_seat.h index aa17d650..15aa6ad8 100644 --- a/include/wlr/types/wlr_seat.h +++ b/include/wlr/types/wlr_seat.h @@ -30,6 +30,15 @@ struct wlr_seat_pointer_state { struct wl_listener focus_resource_destroy_listener; }; +struct wlr_seat_keyboard_state { + struct wlr_seat *wlr_seat; + struct wlr_seat_handle *focused_handle; + struct wlr_surface *focused_surface; + + struct wl_listener focus_surface_destroy_listener; + struct wl_listener focus_resource_destroy_listener; +}; + struct wlr_seat { struct wl_global *wl_global; struct wl_display *display; @@ -39,6 +48,7 @@ struct wlr_seat { struct wlr_data_device *data_device; struct wlr_seat_pointer_state pointer_state; + struct wlr_seat_keyboard_state keyboard_state; struct { struct wl_signal client_bound; @@ -112,4 +122,24 @@ uint32_t wlr_seat_pointer_send_button(struct wlr_seat *wlr_seat, uint32_t time, void wlr_seat_pointer_send_axis(struct wlr_seat *wlr_seat, uint32_t time, enum wlr_axis_orientation orientation, double value); +/** + * Send a keyboard enter event to the given surface and consider it to be the + * focused surface for the keyboard. This will send a leave event to the last + * surface that was entered. + */ +void wlr_seat_keyboard_enter(struct wlr_seat *wlr_seat, + struct wlr_surface *surface); + +/** + * Clear the focused surface for the keyboard and leave all entered surfaces. + */ +void wlr_seat_keyboard_clear_focus(struct wlr_seat *wlr_seat); + +/** + * Send a key event to the surface with keyboard focus. Returns the event + * serial. + */ +uint32_t wlr_seat_keyboard_send_key(struct wlr_seat *wlr_seat, uint32_t time, + uint32_t key, uint32_t state); + #endif |