feat: Initial usage of xkb.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user