aboutsummaryrefslogtreecommitdiff
path: root/kbd.h
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-10-27 15:21:19 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-10-27 15:21:19 +0000
commit061bbd704961b17419fd69344af6268487abb926 (patch)
treedbcd298ccffd325fb97e3deaee5d151df55f4bf8 /kbd.h
parentwayland: move clipboard/primary structs into the wayland struct (diff)
kbd: break out XKB kbd struct to a separate file
Diffstat (limited to 'kbd.h')
-rw-r--r--kbd.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/kbd.h b/kbd.h
new file mode 100644
index 00000000..06de5b50
--- /dev/null
+++ b/kbd.h
@@ -0,0 +1,35 @@
+#pragma once
+
+#include <stdint.h>
+#include <stdbool.h>
+
+#include <xkbcommon/xkbcommon.h>
+
+struct kbd {
+ struct xkb_context *xkb;
+ struct xkb_keymap *xkb_keymap;
+ struct xkb_state *xkb_state;
+ struct xkb_compose_table *xkb_compose_table;
+ struct xkb_compose_state *xkb_compose_state;
+ struct {
+ int fd;
+
+ bool dont_re_repeat;
+ int32_t delay;
+ int32_t rate;
+ uint32_t key;
+ } repeat;
+
+ xkb_mod_index_t mod_shift;
+ xkb_mod_index_t mod_alt;
+ xkb_mod_index_t mod_ctrl;
+ xkb_mod_index_t mod_meta;
+
+ /* Enabled modifiers */
+ bool shift;
+ bool alt;
+ bool ctrl;
+ bool meta;
+};
+
+void kbd_destroy(struct kbd *kbd);