Add XKB interface for x11
This commit is contained in:
parent
7ad237edc1
commit
cf9bace272
15 changed files with 232 additions and 31 deletions
|
@ -1,14 +1,29 @@
|
|||
#pragma once
|
||||
#include "Keyboard.h"
|
||||
|
||||
#include <xcb/xcb.h>
|
||||
#include <xkbcommon/xkbcommon.h>
|
||||
|
||||
struct xcb_xkb_state_notify_event_t;
|
||||
|
||||
class XcbKeyboard : public Keyboard
|
||||
{
|
||||
public:
|
||||
XcbKeyboard();
|
||||
XcbKeyboard(xcb_connection_t* connection);
|
||||
|
||||
static std::unique_ptr<XcbKeyboard> Create();
|
||||
static std::unique_ptr<XcbKeyboard> Create(xcb_connection_t* connection);
|
||||
|
||||
std::string GetKeyString(KeyCode keyCode) override;
|
||||
std::string getKeyString(KeyCode keyCode) override;
|
||||
|
||||
void updateState(xcb_xkb_state_notify_event_t *state);
|
||||
|
||||
private:
|
||||
void getKeyMap();
|
||||
|
||||
xcb_connection_t* mConnection{nullptr};
|
||||
xkb_state* mXkbState{nullptr};
|
||||
xkb_context* mXkbContext{nullptr};
|
||||
xkb_keymap* mXkbKeymap{nullptr};
|
||||
};
|
||||
|
||||
using XcbKeyboardUPtr = std::unique_ptr<XcbKeyboard>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue