Deskflow 1.22.0.197
Keyboard and mouse sharing utility
Loading...
Searching...
No Matches
IKeyState Class Referenceabstract

Key state interface. More...

#include <IKeyState.h>

Inheritance diagram for IKeyState:
Collaboration diagram for IKeyState:

Classes

class  KeyInfo
 Key event data. More...

Public Types

using KeyButtonSet = std::set<KeyButton>

Public Member Functions

 IKeyState (const IEventQueue *events)
manipulators
virtual void updateKeyMap ()=0
 Update the keyboard map.
virtual void updateKeyState ()=0
 Update the key state.
virtual void setHalfDuplexMask (KeyModifierMask)=0
 Set half-duplex mask.
virtual void fakeKeyDown (KeyID id, KeyModifierMask mask, KeyButton button, const std::string &lang)=0
 Fake a key press.
virtual bool fakeKeyRepeat (KeyID id, KeyModifierMask mask, int32_t count, KeyButton button, const std::string &lang)=0
 Fake a key repeat.
virtual bool fakeKeyUp (KeyButton button)=0
 Fake a key release.
virtual void fakeAllKeysUp ()=0
 Fake key releases for all fake pressed keys.
virtual bool fakeCtrlAltDel ()=0
 Fake ctrl+alt+del.
virtual bool fakeMediaKey (KeyID id)=0
 Fake a media key.
accessors
virtual bool isKeyDown (KeyButton) const =0
 Test if key is pressed.
virtual KeyModifierMask getActiveModifiers () const =0
 Get the active modifiers.
virtual KeyModifierMask pollActiveModifiers () const =0
 Get the active modifiers from OS.
virtual int32_t pollActiveGroup () const =0
 Get the active keyboard layout from OS.
virtual void pollPressedKeys (KeyButtonSet &pressedKeys) const =0
 Get the keys currently pressed from OS.
Public Member Functions inherited from IInterface
virtual ~IInterface ()=default
 Interface destructor does nothing.

Static Public Attributes

static const auto s_numButtons = 0x200

Detailed Description

Key state interface.

This interface provides access to set and query the keyboard state and to synthesize key events.

Member Typedef Documentation

◆ KeyButtonSet

Constructor & Destructor Documentation

◆ IKeyState()

IKeyState::IKeyState ( const IEventQueue * events)
explicit

Member Function Documentation

◆ fakeAllKeysUp()

virtual void IKeyState::fakeAllKeysUp ( )
pure virtual

Fake key releases for all fake pressed keys.

Synthesizes a key release event for every key that is synthetically pressed and updates the key state.

Implemented in IPlatformScreen, KeyState, MSWindowsScreen, and PlatformScreen.

◆ fakeCtrlAltDel()

virtual bool IKeyState::fakeCtrlAltDel ( )
pure virtual

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.

Implemented in deskflow::EiKeyState, IPlatformScreen, KeyState, MSWindowsKeyState, OSXKeyState, PlatformScreen, and XWindowsKeyState.

◆ fakeKeyDown()

virtual void IKeyState::fakeKeyDown ( KeyID id,
KeyModifierMask mask,
KeyButton button,
const std::string & lang )
pure virtual

Fake a key press.

Synthesizes a key press event and updates the key state.

Implemented in IPlatformScreen, KeyState, MSWindowsKeyState, MSWindowsScreen, and PlatformScreen.

◆ fakeKeyRepeat()

virtual bool IKeyState::fakeKeyRepeat ( KeyID id,
KeyModifierMask mask,
int32_t count,
KeyButton button,
const std::string & lang )
pure virtual

Fake a key repeat.

Synthesizes a key repeat event and updates the key state.

Implemented in IPlatformScreen, KeyState, MSWindowsKeyState, MSWindowsScreen, and PlatformScreen.

◆ fakeKeyUp()

virtual bool IKeyState::fakeKeyUp ( KeyButton button)
pure virtual

Fake a key release.

Synthesizes a key release event and updates the key state.

Implemented in IPlatformScreen, KeyState, MSWindowsScreen, and PlatformScreen.

◆ fakeMediaKey()

virtual bool IKeyState::fakeMediaKey ( KeyID id)
pure virtual

Fake a media key.

Synthesizes a media key down and up. Only Mac would implement this by use cocoa appkit framework.

Implemented in IPlatformScreen, KeyState, and OSXKeyState.

◆ getActiveModifiers()

virtual KeyModifierMask IKeyState::getActiveModifiers ( ) const
pure virtual

Get the active modifiers.

Returns the modifiers that are currently active according to our shadowed state.

Implemented in IPlatformScreen, KeyState, and PlatformScreen.

◆ isKeyDown()

virtual bool IKeyState::isKeyDown ( KeyButton ) const
pure virtual

Test if key is pressed.

Returns true iff the given key is down. Half-duplex toggles always return false.

Implemented in IPlatformScreen, KeyState, and PlatformScreen.

◆ pollActiveGroup()

virtual int32_t IKeyState::pollActiveGroup ( ) const
pure virtual

Get the active keyboard layout from OS.

Returns the active keyboard layout according to the operating system.

Implemented in deskflow::EiKeyState, IPlatformScreen, KeyState, MSWindowsKeyState, OSXKeyState, PlatformScreen, and XWindowsKeyState.

◆ pollActiveModifiers()

virtual KeyModifierMask IKeyState::pollActiveModifiers ( ) const
pure virtual

Get the active modifiers from OS.

Returns the modifiers that are currently active according to the operating system.

Implemented in deskflow::EiKeyState, IPlatformScreen, KeyState, MSWindowsKeyState, OSXKeyState, PlatformScreen, and XWindowsKeyState.

◆ pollPressedKeys()

virtual void IKeyState::pollPressedKeys ( KeyButtonSet & pressedKeys) const
pure virtual

Get the keys currently pressed from OS.

Adds any keys that are currently pressed according to the operating system to pressedKeys.

Implemented in deskflow::EiKeyState, IPlatformScreen, KeyState, MSWindowsKeyState, OSXKeyState, PlatformScreen, and XWindowsKeyState.

◆ setHalfDuplexMask()

virtual void IKeyState::setHalfDuplexMask ( KeyModifierMask )
pure virtual

Set half-duplex mask.

Sets which modifier toggle keys are half-duplex. A half-duplex toggle key doesn't report a key release when toggled on and doesn't report a key press when toggled off.

Implemented in IPlatformScreen, KeyState, and PlatformScreen.

◆ updateKeyMap()

virtual void IKeyState::updateKeyMap ( )
pure virtual

Update the keyboard map.

Causes the key state to get updated to reflect the current keyboard mapping.

Implemented in IPlatformScreen, KeyState, and PlatformScreen.

◆ updateKeyState()

virtual void IKeyState::updateKeyState ( )
pure virtual

Update the key state.

Causes the key state to get updated to reflect the physical keyboard state.

Implemented in IPlatformScreen, KeyState, and PlatformScreen.

Member Data Documentation

◆ s_numButtons

const auto IKeyState::s_numButtons = 0x200
inlinestatic

The documentation for this class was generated from the following files: