diff options
author | xdavidwu <xdavidwuph@gmail.com> | 2020-07-08 10:48:05 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2020-07-08 11:21:57 +0200 |
commit | 595f324f8b74eebed59176e3889ebccb875c574c (patch) | |
tree | 1fd565501d1668e798446e7b182424fa6235425c /include/wlr | |
parent | 61e2ebac908c33cfaf06a53a09e829ac97eca400 (diff) |
input-method: implement keyboard grabs
Diffstat (limited to 'include/wlr')
-rw-r--r-- | include/wlr/types/wlr_input_method_v2.h | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/include/wlr/types/wlr_input_method_v2.h b/include/wlr/types/wlr_input_method_v2.h index 2ea4a6e5..99361d0c 100644 --- a/include/wlr/types/wlr_input_method_v2.h +++ b/include/wlr/types/wlr_input_method_v2.h @@ -34,6 +34,7 @@ struct wlr_input_method_v2 { struct wl_resource *resource; struct wlr_seat *seat; + struct wlr_seat_client *seat_client; struct wlr_input_method_v2_state pending; struct wlr_input_method_v2_state current; @@ -41,16 +42,33 @@ struct wlr_input_method_v2 { bool client_active; // state known to the client uint32_t current_serial; // received in last commit call + struct wlr_input_method_keyboard_grab_v2 *keyboard_grab; + struct wl_list link; - struct wl_listener seat_destroy; + struct wl_listener seat_client_destroy; struct { struct wl_signal commit; // (struct wlr_input_method_v2*) + struct wl_signal grab_keyboard; // (struct wlr_input_method_keyboard_grab_v2*) struct wl_signal destroy; // (struct wlr_input_method_v2*) } events; }; +struct wlr_input_method_keyboard_grab_v2 { + struct wl_resource *resource; + struct wlr_input_method_v2 *input_method; + struct wlr_keyboard *keyboard; + + struct wl_listener keyboard_keymap; + struct wl_listener keyboard_repeat_info; + struct wl_listener keyboard_destroy; + + struct { + struct wl_signal destroy; // (struct wlr_input_method_keyboard_grab_v2*) + } events; +}; + struct wlr_input_method_manager_v2 { struct wl_global *global; struct wl_list input_methods; // struct wlr_input_method_v2*::link @@ -82,4 +100,16 @@ void wlr_input_method_v2_send_done(struct wlr_input_method_v2 *input_method); void wlr_input_method_v2_send_unavailable( struct wlr_input_method_v2 *input_method); +void wlr_input_method_keyboard_grab_v2_send_key( + struct wlr_input_method_keyboard_grab_v2 *keyboard_grab, + uint32_t time, uint32_t key, uint32_t state); +void wlr_input_method_keyboard_grab_v2_send_modifiers( + struct wlr_input_method_keyboard_grab_v2 *keyboard_grab, + struct wlr_keyboard_modifiers *modifiers); +void wlr_input_method_keyboard_grab_v2_set_keyboard( + struct wlr_input_method_keyboard_grab_v2 *keyboard_grab, + struct wlr_keyboard *keyboard); +void wlr_input_method_keyboard_grab_v2_destroy( + struct wlr_input_method_keyboard_grab_v2 *keyboard_grab); + #endif |