![]() |
Deskflow 1.27.0.7
Keyboard and mouse sharing utility
|
Implementation of IPlatformComputer for X11. More...
#include <EiComputer.h>


Public Member Functions | |
| EiComputer (bool isPrimary, IEventQueue *events, bool usePortal) | |
| ~EiComputer () override | |
| void * | getEventTarget () const final |
| Get event target. | |
| bool | getClipboard (ClipboardID id, IClipboard *) const override |
| Get clipboard. | |
| void | getShape (std::int32_t &x, std::int32_t &y, std::int32_t &width, std::int32_t &height) const override |
| void | getCursorPos (std::int32_t &x, std::int32_t &y) const override |
| void | reconfigure (std::uint32_t activeSides) override |
| std::uint32_t | activeSides () override |
| activeSides | |
| void | warpCursor (std::int32_t x, std::int32_t y) override |
| std::uint32_t | registerHotKey (KeyID key, KeyModifierMask mask) override |
| Register a system hotkey. | |
| void | unregisterHotKey (std::uint32_t id) override |
| void | fakeInputBegin () override |
| Prepare to synthesize input on primary computer. | |
| void | fakeInputEnd () override |
| Done synthesizing input on primary computer. | |
| std::int32_t | getJumpZoneSize () const override |
| Get jump zone size. | |
| bool | isAnyMouseButtonDown (std::uint32_t &buttonID) const override |
| void | getCursorCenter (std::int32_t &x, std::int32_t &y) const override |
| void | fakeMouseButton (ButtonID id, bool press) override |
| Fake mouse press/release. | |
| void | fakeMouseMove (std::int32_t x, std::int32_t y) override |
| void | fakeMouseRelativeMove (std::int32_t dx, std::int32_t dy) const override |
| void | fakeMouseWheel (ScrollDelta delta) const override |
| Synthesize a mouse wheel event of amount This Implmentation for this method should call applyScrollModifier before sending the final delta to the system. | |
| void | fakeKey (std::uint32_t keycode, bool isDown) const |
| void | enable () override |
| Enable computer. | |
| void | disable () override |
| Disable computer. | |
| void | enter () override |
| Enter computer. | |
| bool | canLeave () override |
| Leave computer. | |
| void | leave () override |
| Leave computer. | |
| bool | setClipboard (ClipboardID, const IClipboard *) override |
| Set clipboard. | |
| void | checkClipboards () override |
| Check clipboard owner. | |
| void | openScreensaver (bool notify) override |
| Open screen saver. | |
| void | closeScreensaver () override |
| Close screen saver. | |
| void | screensaver (bool activate) override |
| Activate/deactivate screen saver. | |
| void | resetOptions () override |
| Notify of options changes. | |
| void | setOptions (const OptionsList &options) override |
| Notify of options changes. | |
| void | setSequenceNumber (std::uint32_t) override |
| bool | isPrimary () const override |
| Test if is primary computer. | |
| void | sendClipboardEvent (EventTypes type, ClipboardID id) const |
| EiClipboard * | getClipboardCache () const |
| size_t | maximumClipboardSize () const |
| Public Member Functions inherited from PlatformComputer | |
| PlatformComputer (IEventQueue *events) | |
| ~PlatformComputer () override=default | |
| void | getShape (int32_t &x, int32_t &y, int32_t &width, int32_t &height) const override=0 |
| Get computer shape. | |
| void | getCursorPos (int32_t &x, int32_t &y) const override=0 |
| Get cursor position. | |
| void | reconfigure (uint32_t activeSides) override=0 |
| Update configuration. | |
| void | warpCursor (int32_t x, int32_t y) override=0 |
| Warp cursor. | |
| void | unregisterHotKey (uint32_t id) override=0 |
| Unregister a system hotkey. | |
| bool | isAnyMouseButtonDown (uint32_t &buttonID) const override=0 |
| Test if mouse is pressed. | |
| void | getCursorCenter (int32_t &x, int32_t &y) const override=0 |
| Get cursor center position. | |
| void | fakeMouseMove (int32_t x, int32_t y) override=0 |
| Fake mouse move. | |
| void | fakeMouseRelativeMove (int32_t dx, int32_t dy) const override=0 |
| Fake mouse move. | |
| 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 &) 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 | fakeCtrlAltDel () override |
| Fake ctrl+alt+del. | |
| bool | isKeyDown (KeyButton) const override |
| Test if key is pressed. | |
| KeyModifierMask | getActiveModifiers () const override |
| Get the active modifiers. | |
| KeyModifierMask | pollActiveModifiers () const override |
| Get the active modifiers from OS. | |
| 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. | |
| void | clearStaleModifiers () override |
| Clear stale modifiers. | |
| void | setSequenceNumber (uint32_t) override=0 |
| Set clipboard sequence number. | |
| Public Member Functions inherited from IPlatformComputer | |
| IPlatformComputer (const IEventQueue *events) | |
| bool | fakeMediaKey (KeyID) override |
| Fake a media key. | |
| Public Member Functions inherited from IComputer | |
| virtual | ~IComputer ()=default |
| Public Member Functions inherited from IPrimaryComputer | |
| virtual | ~IPrimaryComputer ()=default |
| Public Member Functions inherited from ISecondaryComputer | |
| ISecondaryComputer () | |
| virtual | ~ISecondaryComputer ()=default |
| ScrollDelta | applyScrollModifier (ScrollDelta delta) const |
| Applies any scroll modfifers to the provided delta, This should only be done inside the subclasses fakeMouseWheel impl. | |
| Public Member Functions inherited from IKeyState | |
| IKeyState (const IEventQueue *events) | |
| virtual | ~IKeyState ()=default |
Protected Member Functions | |
| void | handleSystemEvent (const Event &event) override |
| Handle system event. | |
| void | updateButtons () override |
| Update mouse buttons. | |
| IKeyState * | getKeyState () const override |
| Get the key state. | |
| std::string | getSecureInputApp () const override |
| Determine the name of the app causing a secure input state. | |
| void | updateShape () |
| void | addDevice (ei_device *device) |
| void | removeDevice (ei_device *device) |
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 |
| Static Protected Member Functions inherited from PlatformComputer | |
| static std::string | sidesMaskToString (uint32_t sides) |
| Static Protected Attributes inherited from PlatformComputer | |
| static const auto | s_scrollDelta = 120 |
Implementation of IPlatformComputer for X11.
| deskflow::EiComputer::EiComputer | ( | bool | isPrimary, |
| IEventQueue * | events, | ||
| bool | usePortal ) |
|
override |
|
overridevirtual |
activeSides
Implements PlatformComputer.
|
protected |
|
overridevirtual |
Leave computer.
Called when the user navigates off the computer. Returns true if the leave can proceed. A typical reason for failure is being unable to install the keyboard and mouse snoopers on a primary computer. Secondary computers should not fail.
Implements PlatformComputer.
|
overridevirtual |
Check clipboard owner.
Check ownership of all clipboards and post grab events for any that have changed. This is used as a backup in case the system doesn't reliably report clipboard ownership changes.
Implements PlatformComputer.
|
overridevirtual |
Close screen saver.
Close the screen saver. Stop reporting screen saver activation and deactivation and, if the screen saver was disabled by openScreensaver(), enable the screen saver.
Implements PlatformComputer.
|
overridevirtual |
Disable computer.
Undoes the operations in enable() and events should no longer be reported.
Implements PlatformComputer.
|
overridevirtual |
Enable computer.
Enable the computer, preparing it to report system and user events. For a secondary computer it also means preparing to synthesize events and hiding the cursor.
Implements PlatformComputer.
|
overridevirtual |
|
overridevirtual |
Prepare to synthesize input on primary computer.
Prepares the primary computer to receive synthesized input. We do not want to receive this synthesized input as user input so this method ensures that we ignore it. Calls to fakeInputBegin() may not be nested.
Implements PlatformComputer.
|
overridevirtual |
Done synthesizing input on primary computer.
Undoes whatever fakeInputBegin() did.
Implements PlatformComputer.
| void deskflow::EiComputer::fakeKey | ( | std::uint32_t | keycode, |
| bool | isDown ) const |
|
overridevirtual |
Fake mouse press/release.
Synthesize a press or release of mouse button id.
Implements PlatformComputer.
|
override |
|
override |
|
overridevirtual |
Synthesize a mouse wheel event of amount This Implmentation for this method should call applyScrollModifier before sending the final delta to the system.
| delta | the raw delta to fake |
Implements PlatformComputer.
|
overridevirtual |
Get clipboard.
Save the contents of the clipboard indicated by id and return true iff successful.
Implements PlatformComputer.
|
inline |
|
override |
|
override |
|
finalvirtual |
Get event target.
Returns the target used for events created by this object.
Implements PlatformComputer.
|
overridevirtual |
Get jump zone size.
Return the jump zone size, the size of the regions on the edges of the computer that cause the cursor to jump to another computer.
Implements PlatformComputer.
|
overrideprotectedvirtual |
Get the key state.
Subclasses must implement this method to return the platform specific key state object that each subclass must have.
Implements PlatformComputer.
|
overrideprotectedvirtual |
Determine the name of the app causing a secure input state.
On MacOS check which app causes a secure input state to be enabled. No alternative on other platforms
Implements IPlatformComputer.
|
override |
|
overrideprotectedvirtual |
Handle system event.
A platform computer is expected to install a handler for system events in its c'tor like so:
It should remove the handler in its d'tor. Override the handleSystemEvent() method to process system events. It should post the events IComputer as appropriate.
A primary computer has further responsibilities. It should post the events in IPrimaryComputer as appropriate. It should also call onKey() on its KeyState whenever a key is pressed or released (but not for key repeats). And it should call updateKeyMap() on its KeyState if necessary when the keyboard mapping changes.
The target of all events should be the value returned by getEventTarget().
Implements PlatformComputer.
|
override |
|
overridevirtual |
Test if is primary computer.
Return true iff this computer is a primary computer.
Implements PlatformComputer.
|
overridevirtual |
Leave computer.
Called when the user navigates off the computer. Should be gated by canLeave().
Implements PlatformComputer.
|
inline |
|
overridevirtual |
Open screen saver.
Open the screen saver. If notify is true then this object must send events when the screen saver activates or deactivates until closeScreensaver() is called. If notify is false then the screen saver is disabled and restored on closeScreensaver().
Implements PlatformComputer.
|
override |
|
overridevirtual |
Register a system hotkey.
Registers a system-wide hotkey. The computer should arrange for an event to be delivered to itself when the hot key is pressed or released. When that happens the computer should post a getHotKeyDownEvent() or getHotKeyUpEvent(), respectively. The hot key is key key with exactly the modifiers mask. Returns 0 on failure otherwise an id that can be used to unregister the hotkey.
A hot key is a set of modifiers and a key, which may itself be a modifier. The hot key is pressed when the hot key's modifiers and only those modifiers are logically down (active) and the key is pressed. The hot key is released when the key is released, regardless of the modifiers.
The hot key event should be generated no matter what window or application has the focus. No other window or application should receive the key press or release events (they can and should see the modifier key events). When the key is a modifier, it's acceptable to allow the user to press the modifiers in any order or to require the user to press the given key last.
Implements PlatformComputer.
|
protected |
|
overridevirtual |
|
overridevirtual |
Activate/deactivate screen saver.
Forcibly activate the screen saver if activate is true otherwise forcibly deactivate it.
Implements PlatformComputer.
| void deskflow::EiComputer::sendClipboardEvent | ( | EventTypes | type, |
| ClipboardID | id ) const |
|
overridevirtual |
Set clipboard.
Set the contents of the system clipboard indicated by id.
Implements PlatformComputer.
|
overridevirtual |
Notify of options changes.
Set options to given values. Ignore unknown options and don't modify options that aren't given in options.
Implements PlatformComputer.
|
override |
|
override |
|
overrideprotectedvirtual |
Update mouse buttons.
Subclasses must implement this method to update their internal mouse button mapping and, if desired, state tracking.
Implements PlatformComputer.
|
protected |
|
override |