Deskflow 1.22.0.197
Keyboard and mouse sharing utility
Loading...
Searching...
No Matches
deskflow::EiKeyState Class Reference

A key state for Ei. More...

#include <EiKeyState.h>

Inheritance diagram for deskflow::EiKeyState:
Collaboration diagram for deskflow::EiKeyState:

Public Member Functions

 EiKeyState (EiScreen *screen, IEventQueue *events)
 ~EiKeyState () override
void init (int fd, std::size_t len)
void initDefaultKeymap ()
bool fakeCtrlAltDel () override
 Fake ctrl+alt+del.
KeyModifierMask pollActiveModifiers () const override
 Get the active modifiers from OS.
std::int32_t pollActiveGroup () const override
 Get the active keyboard layout from OS.
void pollPressedKeys (KeyButtonSet &pressedKeys) const override
 Get the keys currently pressed from OS.
KeyID mapKeyFromKeyval (std::uint32_t keyval) const
void updateXkbState (std::uint32_t keyval, bool is_pressed)
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)
Public Member Functions inherited from IInterface
virtual ~IInterface ()=default
 Interface destructor does nothing.

Protected Member Functions

void getKeyMap (KeyMap &keyMap) override
 Get the keyboard map.
void fakeKey (const Keystroke &keystroke) override
 Fake a key event.
Protected Member Functions inherited from KeyState
virtual KeyModifierMaskgetActiveModifiersRValue ()
 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.

Additional Inherited Members

Public Types inherited from IKeyState
using KeyButtonSet = std::set<KeyButton>
Static Public Attributes inherited from IKeyState
static const auto s_numButtons = 0x200
using Keystroke = deskflow::KeyMap::Keystroke

Detailed Description

A key state for Ei.

Constructor & Destructor Documentation

◆ EiKeyState()

deskflow::EiKeyState::EiKeyState ( EiScreen * screen,
IEventQueue * events )

◆ ~EiKeyState()

deskflow::EiKeyState::~EiKeyState ( )
override

Member Function Documentation

◆ fakeCtrlAltDel()

bool deskflow::EiKeyState::fakeCtrlAltDel ( )
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.

◆ fakeKey()

void deskflow::EiKeyState::fakeKey ( const Keystroke & keystroke)
overrideprotectedvirtual

Fake a key event.

Synthesize an event for keystroke.

Implements KeyState.

◆ getKeyMap()

void deskflow::EiKeyState::getKeyMap ( KeyMap & keyMap)
overrideprotectedvirtual

Get the keyboard map.

Fills keyMap with the current keyboard map.

Implements KeyState.

◆ init()

void deskflow::EiKeyState::init ( int fd,
std::size_t len )

◆ initDefaultKeymap()

void deskflow::EiKeyState::initDefaultKeymap ( )

◆ mapKeyFromKeyval()

KeyID deskflow::EiKeyState::mapKeyFromKeyval ( std::uint32_t keyval) const

◆ pollActiveGroup()

std::int32_t deskflow::EiKeyState::pollActiveGroup ( ) const
overridevirtual

Get the active keyboard layout from OS.

Returns the active keyboard layout according to the operating system.

Implements KeyState.

◆ pollActiveModifiers()

KeyModifierMask deskflow::EiKeyState::pollActiveModifiers ( ) const
overridevirtual

Get the active modifiers from OS.

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

Implements KeyState.

◆ pollPressedKeys()

void deskflow::EiKeyState::pollPressedKeys ( KeyButtonSet & pressedKeys) const
overridevirtual

Get the keys currently pressed from OS.

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

Implements KeyState.

◆ updateXkbState()

void deskflow::EiKeyState::updateXkbState ( std::uint32_t keyval,
bool is_pressed )

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