From 779b65bc22e0463f42161f0e03fee2cef9b2d790 Mon Sep 17 00:00:00 2001 From: Mikhail Burakov Date: Sun, 2 Apr 2023 20:45:16 +0200 Subject: Implement support for keyboard events --- window.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'window.c') diff --git a/window.c b/window.c index ff54f70..b7ae0ec 100644 --- a/window.c +++ b/window.c @@ -197,11 +197,12 @@ static void OnWlKeyboardKeymap(void* data, struct wl_keyboard* wl_keyboard, static void OnWlKeyboardEnter(void* data, struct wl_keyboard* wl_keyboard, uint32_t serial, struct wl_surface* surface, struct wl_array* keys) { - (void)data; (void)wl_keyboard; (void)serial; (void)surface; (void)keys; + struct Window* window = data; + window->event_handlers->OnFocus(window->user, true); } static void OnWlKeyboardLeave(void* data, struct wl_keyboard* wl_keyboard, @@ -210,6 +211,8 @@ static void OnWlKeyboardLeave(void* data, struct wl_keyboard* wl_keyboard, (void)wl_keyboard; (void)serial; (void)surface; + struct Window* window = data; + window->event_handlers->OnFocus(window->user, false); } static void OnWlKeyboardKey(void* data, struct wl_keyboard* wl_keyboard, -- cgit v1.2.3