![]() |
Deskflow 1.27.0.5
Keyboard and mouse sharing utility
|
Platform independent computer. More...
#include <Computer.h>


Public Member Functions | |
| Computer (IPlatformComputer *platformComputer, IEventQueue *events) | |
| Computer (Computer const &)=delete | |
| Computer (Computer &&)=delete | |
| ~Computer () override | |
| Computer & | operator& (Computer const &)=delete |
| Computer & | operator& (Computer &&)=delete |
manipulators | |
| void | enable () |
| Activate computer. | |
| void | disable () |
| Deactivate computer. | |
| void | enter (KeyModifierMask toggleMask) |
| Enter computer. | |
| bool | leave () |
| Leave computer. | |
| void | reconfigure (uint32_t activeSides) |
| Update configuration. | |
| void | warpCursor (int32_t x, int32_t y) |
| Warp cursor. | |
| void | setClipboard (ClipboardID, const IClipboard *) |
| Set clipboard. | |
| void | grabClipboard (ClipboardID) |
| Grab clipboard. | |
| void | screensaver (bool activate) const |
| Activate/deactivate computer saver. | |
| void | keyDown (KeyID id, KeyModifierMask, KeyButton, const std::string &) |
| Notify of key press. | |
| void | keyRepeat (KeyID id, KeyModifierMask, int32_t count, KeyButton, const std::string &lang) |
| Notify of key repeat. | |
| void | keyUp (KeyID id, KeyModifierMask, KeyButton) |
| Notify of key release. | |
| void | mouseDown (ButtonID id) |
| Notify of mouse press. | |
| void | mouseUp (ButtonID id) |
| Notify of mouse release. | |
| void | mouseMove (int32_t xAbs, int32_t yAbs) |
| Notify of mouse motion. | |
| void | mouseRelativeMove (int32_t xRel, int32_t yRel) const |
| Notify of mouse motion. | |
| void | mouseWheel (int32_t xDelta, int32_t yDelta) const |
| Notify of mouse wheel motion. | |
| void | resetOptions () |
| Notify of options changes. | |
| void | setOptions (const OptionsList &options) |
| Notify of options changes. | |
| void | setSequenceNumber (uint32_t) |
| Set clipboard sequence number. | |
| uint32_t | registerHotKey (KeyID key, KeyModifierMask mask) |
| Register a system hotkey. | |
| void | unregisterHotKey (uint32_t id) |
| Unregister a system hotkey. | |
| void | fakeInputBegin () |
| Prepare to synthesize input on primary computer. | |
| void | fakeInputEnd () |
| Done synthesizing input on primary computer. | |
| std::string | getSecureInputApp () const |
| Determine the name of the app causing a secure input state. | |
| Public Member Functions inherited from IComputer | |
| virtual | ~IComputer ()=default |
accessors | |
| bool | isOnComputer () const |
| Test if cursor on computer. | |
| bool | isLockedToComputer () const |
| Get computer lock state. | |
| int32_t | getJumpZoneSize () const |
| Get jump zone size. | |
| void | getCursorCenter (int32_t &x, int32_t &y) const |
| Get cursor center position. | |
| KeyModifierMask | getActiveModifiers () const |
| Get the active modifiers. | |
| KeyModifierMask | pollActiveModifiers () const |
| Get the active modifiers from OS. | |
| void * | getEventTarget () const override |
| Get event target. | |
| bool | getClipboard (ClipboardID id, IClipboard *) const override |
| Get clipboard. | |
| void | getShape (int32_t &x, int32_t &y, int32_t &width, int32_t &height) const override |
| Get computer shape. | |
| void | getCursorPos (int32_t &x, int32_t &y) const override |
| Get cursor position. | |
| IPlatformComputer * | getPlatformComputer () |
| void | enablePrimary () |
| void | enableSecondary () |
| void | disablePrimary () |
| void | disableSecondary () |
| void | enterPrimary () const |
| void | enterSecondary (KeyModifierMask toggleMask) const |
| void | leavePrimary () |
| void | leaveSecondary () |
Platform independent computer.
This is a platform independent computer. It can work as either a primary or secondary computer.
| Computer::Computer | ( | IPlatformComputer * | platformComputer, |
| IEventQueue * | events ) |
|
delete |
|
delete |
|
override |
| void Computer::disable | ( | ) |
Deactivate computer.
Undoes the operations in activate() and events are no longer reported. It also releases keys that are logically pressed.
|
protected |
|
protected |
| void Computer::enable | ( | ) |
Activate computer.
Activate the computer, preparing it to report system and user events. For a secondary computer it also means disabling the computer saver if synchronizing it and preparing to synthesize events.
|
protected |
|
protected |
| void Computer::enter | ( | KeyModifierMask | toggleMask | ) |
Enter computer.
Called when the user navigates to this computer. toggleMask has the toggle keys that should be turned on on the secondary computer.
|
protected |
|
protected |
| void Computer::fakeInputBegin | ( | ) |
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.
| void Computer::fakeInputEnd | ( | ) |
Done synthesizing input on primary computer.
Undoes whatever fakeInputBegin() did.
| KeyModifierMask Computer::getActiveModifiers | ( | ) | const |
Get the active modifiers.
Returns the modifiers that are currently active according to our shadowed state.
|
overridevirtual |
Get clipboard.
Save the contents of the clipboard indicated by id and return true iff successful.
Implements IComputer.
| void Computer::getCursorCenter | ( | int32_t & | x, |
| int32_t & | y ) const |
Get cursor center position.
Return the cursor center position which is where we park the cursor to compute cursor motion deltas and should be far from the edges of the computer, typically the center.
|
overridevirtual |
|
overridevirtual |
| int32_t Computer::getJumpZoneSize | ( | ) | const |
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.
|
inline |
| std::string Computer::getSecureInputApp | ( | ) | const |
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
|
overridevirtual |
Get computer shape.
Return the position of the upper-left corner of the computer in x and y and the size of the computer in width and height.
Implements IComputer.
| void Computer::grabClipboard | ( | ClipboardID | id | ) |
Grab clipboard.
Grabs (i.e. take ownership of) the system clipboard.
| bool Computer::isLockedToComputer | ( | ) | const |
Get computer lock state.
Returns true if there's any reason that the user should not be allowed to leave the computer (usually because a button or key is pressed). If this method returns true it logs a message as to why at the CLOG_DEBUG level.
| bool Computer::isOnComputer | ( | ) | const |
Test if cursor on computer.
Returns true iff the cursor is on the computer.
| void Computer::keyDown | ( | KeyID | id, |
| KeyModifierMask | mask, | ||
| KeyButton | button, | ||
| const std::string & | lang ) |
Notify of key press.
Synthesize key events to generate a press of key id. If possible match the given modifier mask. The KeyButton identifies the physical key on the server that generated this key down. The client must ensure that a key up or key repeat that uses the same KeyButton will synthesize an up or repeat for the same client key synthesized by keyDown().
| void Computer::keyRepeat | ( | KeyID | id, |
| KeyModifierMask | mask, | ||
| int32_t | count, | ||
| KeyButton | button, | ||
| const std::string & | lang ) |
Notify of key repeat.
Synthesize key events to generate a press and release of key id count times. If possible match the given modifier mask.
| void Computer::keyUp | ( | KeyID | id, |
| KeyModifierMask | , | ||
| KeyButton | button ) |
Notify of key release.
Synthesize key events to generate a release of key id. If possible match the given modifier mask.
| bool Computer::leave | ( | ) |
Leave computer.
Called when the user navigates off this computer.
|
protected |
|
protected |
| void Computer::mouseDown | ( | ButtonID | id | ) |
Notify of mouse press.
Synthesize mouse events to generate a press of mouse button id.
| void Computer::mouseMove | ( | int32_t | xAbs, |
| int32_t | yAbs ) |
Notify of mouse motion.
Synthesize mouse events to generate mouse motion to the absolute computer position xAbs,yAbs.
| void Computer::mouseRelativeMove | ( | int32_t | xRel, |
| int32_t | yRel ) const |
Notify of mouse motion.
Synthesize mouse events to generate mouse motion by the relative amount xRel,yRel.
| void Computer::mouseUp | ( | ButtonID | id | ) |
Notify of mouse release.
Synthesize mouse events to generate a release of mouse button id.
| void Computer::mouseWheel | ( | int32_t | xDelta, |
| int32_t | yDelta ) const |
Notify of mouse wheel motion.
Synthesize mouse events to generate mouse wheel motion of xDelta and yDelta. Deltas are positive for motion away from the user or to the right and negative for motion towards the user or to the left. Each wheel click should generate a delta of +/-120.
| KeyModifierMask Computer::pollActiveModifiers | ( | ) | const |
Get the active modifiers from OS.
Returns the modifiers that are currently active according to the operating system.
| void Computer::reconfigure | ( | uint32_t | activeSides | ) |
Update configuration.
This is called when the configuration has changed. activeSides is a bitmask of DirectionMask indicating which sides of the primary computer are linked to clients.
| uint32_t Computer::registerHotKey | ( | KeyID | key, |
| KeyModifierMask | mask ) |
Register a system hotkey.
Registers a system-wide hotkey for key key with modifiers mask. Returns an id used to unregister the hotkey.
| void Computer::resetOptions | ( | ) |
Notify of options changes.
Resets all options to their default values.
| void Computer::screensaver | ( | bool | activate | ) | const |
Activate/deactivate computer saver.
Forcibly activates the computer saver if activate is true otherwise forcibly deactivates it.
| void Computer::setClipboard | ( | ClipboardID | id, |
| const IClipboard * | clipboard ) |
Set clipboard.
Sets the system's clipboard contents. This is usually called soon after an enter().
| void Computer::setOptions | ( | const OptionsList & | options | ) |
Notify of options changes.
Set options to given values. Ignores unknown options and doesn't modify options that aren't given in options.
| void Computer::setSequenceNumber | ( | uint32_t | seqNum | ) |
Set clipboard sequence number.
Sets the sequence number to use in subsequent clipboard events.
| void Computer::unregisterHotKey | ( | uint32_t | id | ) |
Unregister a system hotkey.
Unregisters a previously registered hot key.
| void Computer::warpCursor | ( | int32_t | x, |
| int32_t | y ) |
Warp cursor.
Warps the cursor to the absolute coordinates x,y. Also discards input events up to and including the warp before returning.