keyboard.h (1205B)
1 /* Copyright (c), Niclas Meyer <niclas@countingsort.com> 2 * 3 * This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this file, 5 * You can obtain one at https://mozilla.org/MPL/2.0/. 6 */ 7 8 #ifndef KIWMI_INPUT_KEYBOARD_H 9 #define KIWMI_INPUT_KEYBOARD_H 10 11 #include <stdint.h> 12 13 #include <wayland-server.h> 14 #include <xkbcommon/xkbcommon.h> 15 16 struct kiwmi_keyboard { 17 struct wl_list link; 18 struct kiwmi_server *server; 19 struct wlr_input_device *device; 20 struct wl_listener modifiers; 21 struct wl_listener key; 22 struct wl_listener device_destroy; 23 24 struct { 25 struct wl_signal key_down; 26 struct wl_signal key_up; 27 struct wl_signal destroy; 28 } events; 29 }; 30 31 struct kiwmi_keyboard_key_event { 32 const xkb_keysym_t *raw_syms; 33 const xkb_keysym_t *translated_syms; 34 int raw_syms_len; 35 int translated_syms_len; 36 uint32_t keycode; 37 struct kiwmi_keyboard *keyboard; 38 bool handled; 39 }; 40 41 struct kiwmi_keyboard * 42 keyboard_create(struct kiwmi_server *server, struct wlr_input_device *device); 43 void keyboard_destroy(struct kiwmi_keyboard *keyboard); 44 45 #endif /* KIWMI_INPUT_KEYBOARD_H */