Files
wlgol/include/tkeyboard.h
T

25 lines
622 B
C
Raw Normal View History

2024-06-02 19:29:26 +02:00
#ifndef TKEYBOARD_H
#define TKEYBOARD_H
2026-06-13 10:22:08 +02:00
#include <stdint.h>
2024-06-02 19:29:26 +02:00
#include <wayland-client.h>
2026-06-13 10:22:08 +02:00
#include <xkbcommon/xkbcommon.h>
typedef void (*keyboard_key_handler_t)(uint32_t key, uint32_t state, xkb_keysym_t sym, uint32_t mods, void *user_data);
2024-06-02 19:29:26 +02:00
2024-06-02 19:29:26 +02:00
struct keyboard_data {
struct wl_keyboard *keyboard;
2026-06-13 10:22:08 +02:00
struct xkb_context *xkb_context;
struct xkb_keymap *xkb_keymap;
struct xkb_state *xkb_state;
keyboard_key_handler_t handler;
void *user_data;
2024-06-02 19:29:26 +02:00
};
2024-06-02 19:29:26 +02:00
extern const struct wl_keyboard_listener keyboard_listener;
2026-06-13 10:22:08 +02:00
void keyboard_set_handler(struct keyboard_data *kbd, keyboard_key_handler_t handler, void *user_data);
2024-06-02 19:29:26 +02:00
#endif