![]() |
Deskflow 1.24.0.365
Keyboard and mouse sharing utility
|
X Windows key state. More...
#include <XWindowsKeyState.h>


Public Types | |
| using | KeycodeList = std::vector<int> |
| Public Types inherited from IKeyState | |
| using | KeyButtonSet = std::set<KeyButton> |
Public Member Functions | |
| XWindowsKeyState (Display *, bool useXKB, IEventQueue *events) | |
| XWindowsKeyState (Display *, bool useXKB, IEventQueue *events, deskflow::KeyMap &keyMap) | |
| ~XWindowsKeyState () override | |
modifiers | |
| void | setActiveGroup (int32_t group) |
| Set active group. | |
| void | setAutoRepeat (const XKeyboardState &) |
| Set the auto-repeat state. | |
| Public Member Functions inherited from KeyState | |
| KeyState (IEventQueue *events, std::vector< std::string > layouts, bool isLangSyncEnabled) | |
| KeyState (IEventQueue *events, deskflow::KeyMap &keyMap, std::vector< std::string > layouts, bool isLangSyncEnabled) | |
| ~KeyState () override | |
| virtual void | onKey (KeyButton button, bool down, KeyModifierMask newState) |
| Handle key event. | |
| virtual void | sendKeyEvent (void *target, bool press, bool isAutoRepeat, KeyID key, KeyModifierMask mask, int32_t count, KeyButton button) |
| Post a key event. | |
| void | updateKeyMap (deskflow::KeyMap *existing) |
| void | updateKeyMap () override |
| Update the keyboard map. | |
| void | updateKeyState () override |
| Update the key state. | |
| void | setHalfDuplexMask (KeyModifierMask) override |
| Set half-duplex mask. | |
| void | fakeKeyDown (KeyID id, KeyModifierMask mask, KeyButton button, const std::string &lang) override |
| Fake a key press. | |
| bool | fakeKeyRepeat (KeyID id, KeyModifierMask mask, int32_t count, KeyButton button, const std::string &lang) override |
| Fake a key repeat. | |
| bool | fakeKeyUp (KeyButton button) override |
| Fake a key release. | |
| void | fakeAllKeysUp () override |
| Fake key releases for all fake pressed keys. | |
| bool | fakeMediaKey (KeyID id) override |
| Fake a media key. | |
| bool | isKeyDown (KeyButton) const override |
| Test if key is pressed. | |
| KeyModifierMask | getActiveModifiers () const override |
| Get the active modifiers. | |
| int32_t | getKeyState (KeyButton keyButton) const |
| Public Member Functions inherited from IKeyState | |
| IKeyState (const IEventQueue *events) | |
| virtual | ~IKeyState ()=default |
| virtual void | clearStaleModifiers () |
| Clear stale modifiers. | |
Static Public Attributes | |
| static const auto | s_groupPoll = -1 |
| static const auto | s_groupPollAndSet = -2 |
| Static Public Attributes inherited from IKeyState | |
| static const auto | s_numButtons = 0x200 |
accessors | |
| KeyModifierMask | mapModifiersFromX (unsigned int state) const |
| Convert X modifier mask to deskflow mask. | |
| bool | mapModifiersToX (KeyModifierMask, unsigned int &) const |
| Convert deskflow modifier mask to X mask. | |
| void | mapKeyToKeycodes (KeyID key, KeycodeList &keycodes) const |
| Convert deskflow key to all corresponding X keycodes. | |
| bool | fakeCtrlAltDel () override |
| Fake ctrl+alt+del. | |
| KeyModifierMask | pollActiveModifiers () const override |
| Get the active modifiers from OS. | |
| int32_t | pollActiveGroup () const final |
| Get the active keyboard layout from OS. | |
| void | pollPressedKeys (KeyButtonSet &pressedKeys) const override |
| Get the keys currently pressed from OS. | |
| void | getKeyMap (deskflow::KeyMap &keyMap) override |
| Get the keyboard map. | |
| void | fakeKey (const Keystroke &keystroke) override |
| Fake a key event. | |
Additional Inherited Members | |
| using | Keystroke = deskflow::KeyMap::Keystroke |
| Protected Member Functions inherited from KeyState | |
| virtual KeyModifierMask & | getActiveModifiersRValue () |
| Get the active modifiers. | |
| int32_t | getEffectiveGroup (int32_t group, int32_t offset) const |
| Compute a group number. | |
| virtual bool | isIgnoredKey (KeyID key, KeyModifierMask mask) const |
| Check if key is ignored. | |
| KeyButton | getButton (KeyID id, int32_t group) const |
| Get button for a KeyID. | |
X Windows key state.
A key state for X Windows.
| using XWindowsKeyState::KeycodeList = std::vector<int> |
| XWindowsKeyState::XWindowsKeyState | ( | Display * | display, |
| bool | useXKB, | ||
| IEventQueue * | events ) |
| XWindowsKeyState::XWindowsKeyState | ( | Display * | display, |
| bool | useXKB, | ||
| IEventQueue * | events, | ||
| deskflow::KeyMap & | keyMap ) |
|
override |
|
overridevirtual |
Fake ctrl+alt+del.
Synthesize a press of ctrl+alt+del. Return true if processing is complete and false if normal key processing should continue.
Implements KeyState.
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
| void XWindowsKeyState::mapKeyToKeycodes | ( | KeyID | key, |
| KeycodeList & | keycodes ) const |
Convert deskflow key to all corresponding X keycodes.
Converts the deskflow key key to all of the keycodes that map to that key.
| KeyModifierMask XWindowsKeyState::mapModifiersFromX | ( | unsigned int | state | ) | const |
Convert X modifier mask to deskflow mask.
Returns the deskflow modifier mask corresponding to the X modifier mask in state.
| bool XWindowsKeyState::mapModifiersToX | ( | KeyModifierMask | mask, |
| unsigned int & | modifiers ) const |
Convert deskflow modifier mask to X mask.
Converts the deskflow modifier mask to the corresponding X modifier mask. Returns true if successful and false if any modifier could not be converted.
|
finalvirtual |
Get the active keyboard layout from OS.
Returns the active keyboard layout according to the operating system.
Implements KeyState.
|
overridevirtual |
Get the active modifiers from OS.
Returns the modifiers that are currently active according to the operating system.
Implements KeyState.
|
overridevirtual |
Get the keys currently pressed from OS.
Adds any keys that are currently pressed according to the operating system to pressedKeys.
Implements KeyState.
| void XWindowsKeyState::setActiveGroup | ( | int32_t | group | ) |
Set active group.
Sets the active group to group. This is the group returned by pollActiveGroup(). If group is s_groupPoll then pollActiveGroup() will really poll, but that's a slow operation on X11. If group is s_groupPollAndSet then this will poll the active group now and use it for future calls to pollActiveGroup().
| void XWindowsKeyState::setAutoRepeat | ( | const XKeyboardState & | state | ) |
Set the auto-repeat state.
Sets the auto-repeat state.
|
inlinestatic |
|
inlinestatic |