From 2be309de1df5e4262175fbcc58e6dd8de4e0e6d3 Mon Sep 17 00:00:00 2001 From: JS Deck Date: Mon, 4 Aug 2025 16:29:39 -0300 Subject: virtualkeyboard: Add options to skip releasing pressed keys on close and to skip sharing key states (#11214) --- src/devices/IKeyboard.hpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'src/devices/IKeyboard.hpp') 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 aq() = 0; + virtual uint32_t getCapabilities(); + virtual eHIDType getType(); + virtual bool isVirtual() = 0; + virtual wl_client* getClient() { + return nullptr; + }; + virtual SP 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 m_pressedXKB; + std::vector m_pressed; + + protected: + bool updatePressed(uint32_t key, bool pressed); + bool m_shareStates = true; }; -- cgit v1.2.3