diff options
| author | JS Deck <jsdeckerido@gmail.com> | 2025-08-04 16:29:39 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-04 21:29:39 +0200 |
| commit | 2be309de1df5e4262175fbcc58e6dd8de4e0e6d3 (patch) | |
| tree | 866629ba5a4b9b45d8720383e4332726444f3566 /src/devices/IKeyboard.hpp | |
| parent | 6491bb4fb7c7e86d9168a104d5b87ace4e1b978d (diff) | |
virtualkeyboard: Add options to skip releasing pressed keys on close and to skip sharing key states (#11214)
Diffstat (limited to 'src/devices/IKeyboard.hpp')
| -rw-r--r-- | src/devices/IKeyboard.hpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/devices/IKeyboard.hpp b/src/devices/IKeyboard.hpp index 25a7efd1..f4fb667b 100644 --- a/src/devices/IKeyboard.hpp +++ b/src/devices/IKeyboard.hpp @@ -24,10 +24,13 @@ enum eKeyboardModifiers { class IKeyboard : public IHID { public: virtual ~IKeyboard(); - virtual uint32_t getCapabilities(); - virtual eHIDType getType(); - virtual bool isVirtual() = 0; - virtual SP<Aquamarine::IKeyboard> aq() = 0; + virtual uint32_t getCapabilities(); + virtual eHIDType getType(); + virtual bool isVirtual() = 0; + virtual wl_client* getClient() { + return nullptr; + }; + virtual SP<Aquamarine::IKeyboard> aq() = 0; struct SKeyEvent { uint32_t timeMs = 0; @@ -73,6 +76,8 @@ class IKeyboard : public IHID { bool updateModifiersState(); // rets whether changed void updateXkbStateWithKey(uint32_t xkbKey, bool pressed); void updateKeymapFD(); + bool getPressed(uint32_t key); + bool shareStates(); bool m_active = false; bool m_enabled = true; @@ -118,5 +123,9 @@ class IKeyboard : public IHID { private: void clearManuallyAllocd(); - std::vector<uint32_t> m_pressedXKB; + std::vector<uint32_t> m_pressed; + + protected: + bool updatePressed(uint32_t key, bool pressed); + bool m_shareStates = true; }; |
