summaryrefslogtreecommitdiff
path: root/src/xcb_xkb.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/xcb_xkb.hh')
-rw-r--r--src/xcb_xkb.hh30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/xcb_xkb.hh b/src/xcb_xkb.hh
new file mode 100644
index 0000000..7bb3681
--- /dev/null
+++ b/src/xcb_xkb.hh
@@ -0,0 +1,30 @@
+#ifndef XCB_XKB_HH
+#define XCB_XKB_HH
+
+#include <memory>
+#include <string>
+#include <xcb/xcb.h>
+#include <xcb/xproto.h>
+
+namespace xcb {
+
+class Keyboard {
+public:
+ virtual ~Keyboard() = default;
+
+ virtual bool handle_event(xcb_connection_t* conn,
+ xcb_generic_event_t* event) = 0;
+
+ virtual std::string get_utf8(xcb_key_press_event_t* event) = 0;
+
+ static std::unique_ptr<Keyboard> create(xcb_connection_t* conn);
+
+protected:
+ Keyboard() = default;
+ Keyboard(Keyboard const&) = delete;
+ Keyboard& operator=(Keyboard const&) = delete;
+};
+
+} // namespace xcb
+
+#endif // XCB_XKB_HH