19#define WIN32_LEAN_AND_MEAN
27class MSWindowsDropTarget;
47 static void init(HINSTANCE);
64 void getShape(int32_t &
x, int32_t &
y, int32_t &width, int32_t &height)
const override;
103 void fakeMouseWheel(int32_t xDelta, int32_t yDelta)
const override;
115 void enter()
override;
117 void leave()
override;
140 HCURSOR createBlankCursor()
const;
141 void destroyCursor(HCURSOR cursor)
const;
142 ATOM createWindowClass()
const;
143 ATOM createDeskWindowClass(
bool isPrimary)
const;
144 void destroyClass(ATOM windowClass)
const;
145 HWND createWindow(ATOM windowClass,
const char *
name)
const;
146 void destroyWindow(HWND)
const;
157 bool onPreDispatch(HWND, UINT, WPARAM, LPARAM);
161 bool onPreDispatchPrimary(HWND, UINT, WPARAM, LPARAM);
165 bool onPreDispatchSecondary(HWND, UINT, WPARAM, LPARAM);
169 bool onEvent(HWND, UINT, WPARAM, LPARAM, LRESULT *result);
172 bool onMark(uint32_t mark);
173 bool onKey(WPARAM, LPARAM);
174 bool onHotKey(WPARAM, LPARAM);
175 bool onMouseButton(WPARAM, LPARAM);
176 bool onMouseMove(int32_t
x, int32_t
y);
177 bool onMouseWheel(int32_t xDelta, int32_t yDelta);
178 bool onScreensaver(
bool activated);
179 bool onDisplayChange();
180 void onClipboardChange();
183 void warpCursorNoFlush(int32_t
x, int32_t
y);
192 void updateScreenShape();
198 void fixClipboardViewer();
201 void enableSpecialKeys(
bool)
const;
204 ButtonID mapButtonFromEvent(WPARAM msg, LPARAM button)
const;
207 bool mapPressFromEvent(WPARAM msg, LPARAM button)
const;
210 void updateKeysCB(
void *);
214 void forceShowCursor();
220 void updateForceShowCursor();
223 static LRESULT CALLBACK wndProc(HWND, UINT, WPARAM, LPARAM);
226 void saveMousePosition(int32_t
x, int32_t
y);
235 HotKeyItem(UINT vk, UINT modifiers);
237 UINT getVirtualKey()
const;
239 bool operator<(
const HotKeyItem &)
const;
245 using HotKeyMap = std::map<uint32_t, HotKeyItem>;
246 using HotKeyIDList = std::vector<uint32_t>;
247 using HotKeyToIDMap = std::map<HotKeyItem, uint32_t>;
248 using PrimaryKeyDownList = std::vector<KeyButton>;
250 static HINSTANCE s_windowInstance;
269 int32_t m_xCenter = 0;
270 int32_t m_yCenter = 0;
273 bool m_multimon =
false;
276 int32_t m_xCursor = 0;
277 int32_t m_yCursor = 0;
280 uint32_t m_sequenceNumber = 0;
284 uint32_t m_markReceived = 0;
293 HKL m_keyLayout =
nullptr;
297 bool m_screensaverNotify =
false;
298 bool m_screensaverActive =
false;
302 HWND m_window =
nullptr;
303 DWORD m_clipboardSequenceNumber = 0;
304 bool m_ownClipboard =
false;
314 HotKeyIDList m_oldHotKeyIDs;
315 HotKeyToIDMap m_hotKeyToIDMap;
332 bool m_showingMouse =
false;
333 bool m_gotOldMouseKeys;
334 MOUSEKEYS m_mouseKeys;
335 MOUSEKEYS m_oldMouseKeys;
343 std::string m_desktopPath;
345 PrimaryKeyDownList m_primaryKeyDownList;
static const struct sockaddr FAR * name
Definition ArchNetworkWinsock.cpp:27
static const WSAEVENT FAR DWORD
Definition ArchNetworkWinsock.cpp:54
static int type
Definition ArchNetworkWinsock.cpp:44
uint8_t ClipboardID
Clipboard ID.
Definition ClipboardTypes.h:16
int key
Definition KeySequence.cpp:15
uint32_t KeyID
Key ID.
Definition KeyTypes.h:22
uint16_t KeyButton
Key Code.
Definition KeyTypes.h:35
uint32_t KeyModifierMask
Modifier key mask.
Definition KeyTypes.h:45
uint8_t ButtonID
Mouse button ID.
Definition MouseTypes.h:16
static const ButtonID kButtonExtra0
Definition MouseTypes.h:24
std::vector< uint32_t > OptionsList
Definition OptionTypes.h:27
int y
Definition ServerConfig.cpp:27
int x
Definition ServerConfig.cpp:26
Definition SimpleEventQueueBuffer.cpp:13
Event.
Definition Event.h:27
Clipboard interface.
Definition IClipboard.h:20
Event queue interface.
Definition IEventQueue.h:32
IKeyState(const IEventQueue *events)
Definition IKeyState.cpp:18
Microsoft Windows desk handling.
Definition MSWindowsDesks.h:47
Loads and provides functions for the Windows hook.
Definition MSWindowsHook.h:47
Microsoft Windows key mapper.
Definition MSWindowsKeyState.h:28
Definition MSWindowsPowerManager.h:11
Microsoft windows screen saver implementation.
Definition MSWindowsScreenSaver.h:19
void fakeMouseRelativeMove(int32_t dx, int32_t dy) const override
Fake mouse move.
Definition MSWindowsScreen.cpp:704
void unregisterHotKey(uint32_t id) override
Unregister a system hotkey.
Definition MSWindowsScreen.cpp:616
uint32_t registerHotKey(KeyID key, KeyModifierMask mask) override
Register a system hotkey.
Definition MSWindowsScreen.cpp:538
static HINSTANCE getWindowInstance()
Get instance.
Definition MSWindowsScreen.cpp:169
void warpCursor(int32_t x, int32_t y) override
Warp cursor.
Definition MSWindowsScreen.cpp:515
bool canLeave() override
Leave screen.
Definition MSWindowsScreen.cpp:261
void getShape(int32_t &x, int32_t &y, int32_t &width, int32_t &height) const override
Get screen shape.
Definition MSWindowsScreen.cpp:425
void leave() override
Leave screen.
Definition MSWindowsScreen.cpp:274
void handleSystemEvent(const Event &event) override
Handle system event.
Definition MSWindowsScreen.cpp:835
void enter() override
Enter screen.
Definition MSWindowsScreen.cpp:231
void setSequenceNumber(uint32_t) override
Set clipboard sequence number.
Definition MSWindowsScreen.cpp:403
~MSWindowsScreen() override
Definition MSWindowsScreen.cpp:142
bool isAnyMouseButtonDown(uint32_t &buttonID) const override
Test if mouse is pressed.
Definition MSWindowsScreen.cpp:668
void enable() override
Enable screen.
Definition MSWindowsScreen.cpp:174
void fakeInputBegin() override
Prepare to synthesize input on primary screen.
Definition MSWindowsScreen.cpp:643
static void init(HINSTANCE)
Initialize.
Definition MSWindowsScreen.cpp:160
void * getEventTarget() const override
Get event target.
Definition MSWindowsScreen.cpp:413
bool fakeKeyRepeat(KeyID id, KeyModifierMask mask, int32_t count, KeyButton button, const std::string &lang) override
Fake a key repeat.
Definition MSWindowsScreen.cpp:727
void updateButtons() override
Update mouse buttons.
Definition MSWindowsScreen.cpp:847
void getCursorPos(int32_t &x, int32_t &y) const override
Get cursor position.
Definition MSWindowsScreen.cpp:435
void sendEvent(EventTypes type, void *=nullptr)
Definition MSWindowsScreen.cpp:818
void closeScreensaver() override
Close screen saver.
Definition MSWindowsScreen.cpp:368
virtual void updateKeys()
Definition MSWindowsScreen.cpp:716
void screensaver(bool activate) override
Activate/deactivate screen saver.
Definition MSWindowsScreen.cpp:380
IKeyState * getKeyState() const override
Get the key state.
Definition MSWindowsScreen.cpp:858
void getCursorCenter(int32_t &x, int32_t &y) const override
Get cursor center position.
Definition MSWindowsScreen.cpp:684
void openScreensaver(bool notify) override
Open screen saver.
Definition MSWindowsScreen.cpp:356
void fakeMouseMove(int32_t x, int32_t y) override
Fake mouse move.
Definition MSWindowsScreen.cpp:699
bool setClipboard(ClipboardID, const IClipboard *) override
Set clipboard.
Definition MSWindowsScreen.cpp:318
void resetOptions() override
Notify of options changes.
Definition MSWindowsScreen.cpp:393
MSWindowsScreen(bool isPrimary, bool noHooks, IEventQueue *events, bool enableLangSync=false, deskflow::ClientScrollDirection scrollDirection=deskflow::ClientScrollDirection::Normal)
Definition MSWindowsScreen.cpp:82
std::string getSecureInputApp() const override
Determine the name of the app causing a secure input state.
Definition MSWindowsScreen.cpp:1674
void fakeInputEnd() override
Done synthesizing input on primary screen.
Definition MSWindowsScreen.cpp:653
void setOptions(const OptionsList &options) override
Notify of options changes.
Definition MSWindowsScreen.cpp:398
void fakeMouseWheel(int32_t xDelta, int32_t yDelta) const override
Fake mouse wheel.
Definition MSWindowsScreen.cpp:709
void fakeAllKeysUp() override
Fake key releases for all fake pressed keys.
Definition MSWindowsScreen.cpp:743
void checkClipboards() override
Check clipboard owner.
Definition MSWindowsScreen.cpp:335
virtual bool setThisCursorPos(int x, int y)
Sets the cursor position on the current machine.
Definition MSWindowsScreen.cpp:465
bool isPrimary() const override
Test if is primary screen.
Definition MSWindowsScreen.cpp:408
int32_t getJumpZoneSize() const override
Get jump zone size.
Definition MSWindowsScreen.cpp:663
void disable() override
Disable screen.
Definition MSWindowsScreen.cpp:199
virtual bool getThisCursorPos(LPPOINT pos)
Get the position of the cursor on the current machine.
Definition MSWindowsScreen.cpp:447
void fakeMouseButton(ButtonID id, bool press) override
Fake mouse press/release.
Definition MSWindowsScreen.cpp:690
bool getClipboard(ClipboardID id, IClipboard *) const override
Get clipboard.
Definition MSWindowsScreen.cpp:418
void fakeKeyDown(KeyID id, KeyModifierMask mask, KeyButton button, const std::string &lang) override
Fake a key press.
Definition MSWindowsScreen.cpp:721
void fakeLocalKey(KeyButton button, bool press) const
Definition MSWindowsScreen.cpp:1643
void reconfigure(uint32_t activeSides) override
Update configuration.
Definition MSWindowsScreen.cpp:502
bool fakeKeyUp(KeyButton button) override
Fake a key release.
Definition MSWindowsScreen.cpp:736
uint32_t activeSides() override
activeSides
Definition MSWindowsScreen.cpp:510
virtual void updateDesktopThread()
This function will attempt to switch to the current desktop the mouse is located on.
Definition MSWindowsScreen.cpp:483
Thread handle.
Definition Thread.h:33
ClientScrollDirection
Definition ClientArgs.h:13
@ Normal
Same direction as the server.
Definition ClientArgs.h:14
EventTypes
Definition EventTypes.h:13