aboutsummaryrefslogtreecommitdiff
path: root/include/wlr
diff options
context:
space:
mode:
authorTony Crisci <tony@dubstepdish.com>2018-01-21 15:09:33 -0500
committerTony Crisci <tony@dubstepdish.com>2018-01-21 15:09:33 -0500
commit7474f005917fbb98cad08e8078c1da0c27742174 (patch)
tree276559dbe3c24ecc6626258132666ae736427a36 /include/wlr
parent61bd79200cc3892b143b7321886db77e97c9f69f (diff)
parent79f2c8719364529056229b99bf9e49a994699fe7 (diff)
Merge branch 'master' into decorations
Diffstat (limited to 'include/wlr')
-rw-r--r--include/wlr/types/wlr_keyboard.h14
-rw-r--r--include/wlr/types/wlr_seat.h27
2 files changed, 27 insertions, 14 deletions
diff --git a/include/wlr/types/wlr_keyboard.h b/include/wlr/types/wlr_keyboard.h
index d32d6e96..c67cc4c2 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..c2a89f33 100644
--- a/include/wlr/types/wlr_seat.h
+++ b/include/wlr/types/wlr_seat.h
@@ -68,10 +68,12 @@ struct wlr_seat_keyboard_grab;
struct wlr_keyboard_grab_interface {
void (*enter)(struct wlr_seat_keyboard_grab *grab,
- struct wlr_surface *surface);
+ struct wlr_surface *surface, uint32_t keycodes[],
+ size_t num_keycodes, struct wlr_keyboard_modifiers *modifiers);
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 +347,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,21 +382,24 @@ 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
* focused surface for this keyboard. Defers to any current grab of the seat's
* keyboard.
*/
-void wlr_seat_keyboard_notify_enter(struct wlr_seat *wlr_seat,
- struct wlr_surface *surface);
+void wlr_seat_keyboard_notify_enter(struct wlr_seat *seat,
+ struct wlr_surface *surface, uint32_t keycodes[], size_t num_keycodes,
+ struct wlr_keyboard_modifiers *modifiers);
/**
* Send a keyboard enter event to the given surface and consider it to be the
@@ -398,8 +408,9 @@ void wlr_seat_keyboard_notify_enter(struct wlr_seat *wlr_seat,
* `wlr_seat_keyboard_notify_enter()` to change keyboard focus to respect
* keyboard grabs.
*/
-void wlr_seat_keyboard_enter(struct wlr_seat *wlr_seat,
- struct wlr_surface *surface);
+void wlr_seat_keyboard_enter(struct wlr_seat *seat,
+ struct wlr_surface *surface, uint32_t keycodes[], size_t num_keycodes,
+ struct wlr_keyboard_modifiers *modifiers);
/**
* Clear the focused surface for the keyboard and leave all entered surfaces.