7874a5f7c6
Add configurable key bindings (TOML), modifier-aware dispatch, mouse-driven pattern placement with preview and rotation, cell grid storage/rendering, and fractional/integer HiDPI scaling. Archive the input-and-placement change and sync its specs to main specs. Tests: Hashtable, Config, Grid, Pattern (4/4 pass).
25 lines
622 B
C
25 lines
622 B
C
#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, uint32_t mods, 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
|