virtualkeyboard: Add options to skip releasing pressed keys on close and to skip sharing key states (#11214)

This commit is contained in:
JS Deck 2025-08-04 16:29:39 -03:00 committed by GitHub
parent 6491bb4fb7
commit 2be309de1d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 416 additions and 137 deletions

View file

@ -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;
};