feat: Initial usage of xkb.

This commit is contained in:
2026-06-13 10:22:08 +02:00
parent 32ff1b18c0
commit ca89ada4b1
5 changed files with 121 additions and 8 deletions
+12
View File
@@ -1,12 +1,24 @@
#ifndef TKEYBOARD_H
#define TKEYBOARD_H
#include <stdint.h>
#include <wayland-client.h>
#include <xkbcommon/xkbcommon.h>
typedef void (*keyboard_key_handler_t)(uint32_t key, uint32_t state, xkb_keysym_t sym, void *user_data);
struct keyboard_data {
struct wl_keyboard *keyboard;
struct xkb_context *xkb_context;
struct xkb_keymap *xkb_keymap;
struct xkb_state *xkb_state;
keyboard_key_handler_t handler;
void *user_data;
};
extern const struct wl_keyboard_listener keyboard_listener;
void keyboard_set_handler(struct keyboard_data *kbd, keyboard_key_handler_t handler, void *user_data);
#endif