Deskflow
1.26.0.418
Keyboard and mouse sharing utility
Toggle main menu visibility
Loading...
Searching...
No Matches
MSWindowsHook.h
Go to the documentation of this file.
1
/*
2
* Deskflow -- mouse and keyboard sharing utility
3
* SPDX-FileCopyrightText: (C) 2012 - 2016 Synergy App Ltd
4
* SPDX-FileCopyrightText: (C) 2011 Chris Schoeneman
5
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
6
*/
7
8
#pragma once
9
10
#include <stdint.h>
11
12
#define WIN32_LEAN_AND_MEAN
13
#include <Windows.h>
14
15
#define DESKFLOW_MSG_MARK WM_APP + 0x0011
// mark id; <unused>
16
#define DESKFLOW_MSG_KEY WM_APP + 0x0012
// vk code; key data
17
#define DESKFLOW_MSG_MOUSE_BUTTON WM_APP + 0x0013
// button msg; <unused>
18
#define DESKFLOW_MSG_MOUSE_WHEEL WM_APP + 0x0014
// delta; <unused>
19
#define DESKFLOW_MSG_MOUSE_MOVE WM_APP + 0x0015
// x; y
20
#define DESKFLOW_MSG_POST_WARP WM_APP + 0x0016
// <unused>; <unused>
21
#define DESKFLOW_MSG_PRE_WARP WM_APP + 0x0017
// x; y
22
#define DESKFLOW_MSG_SCREEN_SAVER WM_APP + 0x0018
// activated; <unused>
23
#define DESKFLOW_MSG_DEBUG WM_APP + 0x0019
// data, data
24
#define DESKFLOW_MSG_INPUT_FIRST DESKFLOW_MSG_KEY
25
#define DESKFLOW_MSG_INPUT_LAST DESKFLOW_MSG_PRE_WARP
26
#define DESKFLOW_HOOK_LAST_MSG DESKFLOW_MSG_DEBUG
27
28
#define DESKFLOW_HOOK_FAKE_INPUT_VIRTUAL_KEY VK_CANCEL
29
#define DESKFLOW_HOOK_FAKE_INPUT_SCANCODE 0
30
31
enum
EHookResult
32
{
33
kHOOK_FAILED
,
34
kHOOK_OKAY
,
35
kHOOK_OKAY_LL
36
};
37
38
enum
EHookMode
39
{
40
kHOOK_DISABLE
,
41
kHOOK_WATCH_JUMP_ZONE
,
42
kHOOK_RELAY_EVENTS
43
};
44
46
class
MSWindowsHook
47
{
48
public
:
49
MSWindowsHook
() =
default
;
50
~MSWindowsHook
();
51
52
void
loadLibrary
();
53
54
int
init
(
DWORD
threadID);
55
56
int
cleanup
();
57
58
void
setSides
(uint32_t sides);
59
uint32_t
getSides
();
60
61
void
setZone
(int32_t x, int32_t y, int32_t w, int32_t h, int32_t jumpZoneSize);
62
63
void
setMode
(
EHookMode
mode);
64
66
static
bool
getPhysicalKeyState
(BYTE keys[256]);
67
68
static
EHookResult
install
();
69
70
static
int
uninstall
();
71
72
static
int
installScreenSaver
();
73
74
static
int
uninstallScreenSaver
();
75
};
DWORD
static const WSAEVENT FAR DWORD
Definition
ArchNetworkWinsock.cpp:56
EHookMode
EHookMode
Definition
MSWindowsHook.h:39
kHOOK_WATCH_JUMP_ZONE
@ kHOOK_WATCH_JUMP_ZONE
Definition
MSWindowsHook.h:41
kHOOK_DISABLE
@ kHOOK_DISABLE
Definition
MSWindowsHook.h:40
kHOOK_RELAY_EVENTS
@ kHOOK_RELAY_EVENTS
Definition
MSWindowsHook.h:42
EHookResult
EHookResult
Definition
MSWindowsHook.h:32
kHOOK_FAILED
@ kHOOK_FAILED
Definition
MSWindowsHook.h:33
kHOOK_OKAY_LL
@ kHOOK_OKAY_LL
Definition
MSWindowsHook.h:35
kHOOK_OKAY
@ kHOOK_OKAY
Definition
MSWindowsHook.h:34
MSWindowsHook::setMode
void setMode(EHookMode mode)
Definition
MSWindowsHook.cpp:141
MSWindowsHook::setZone
void setZone(int32_t x, int32_t y, int32_t w, int32_t h, int32_t jumpZoneSize)
Definition
MSWindowsHook.cpp:132
MSWindowsHook::loadLibrary
void loadLibrary()
Definition
MSWindowsHook.cpp:57
MSWindowsHook::cleanup
int cleanup()
Definition
MSWindowsHook.cpp:113
MSWindowsHook::uninstallScreenSaver
static int uninstallScreenSaver()
Definition
MSWindowsHook.cpp:731
MSWindowsHook::getPhysicalKeyState
static bool getPhysicalKeyState(BYTE keys[256])
Copy the hook's physical key state; false until it has observed an event.
Definition
MSWindowsHook.cpp:150
MSWindowsHook::getSides
uint32_t getSides()
Definition
MSWindowsHook.cpp:127
MSWindowsHook::installScreenSaver
static int installScreenSaver()
Definition
MSWindowsHook.cpp:713
MSWindowsHook::setSides
void setSides(uint32_t sides)
Definition
MSWindowsHook.cpp:122
MSWindowsHook::install
static EHookResult install()
Definition
MSWindowsHook.cpp:620
MSWindowsHook::init
int init(DWORD threadID)
Definition
MSWindowsHook.cpp:71
MSWindowsHook::uninstall
static int uninstall()
Definition
MSWindowsHook.cpp:671
MSWindowsHook::MSWindowsHook
MSWindowsHook()=default
src
lib
platform
MSWindowsHook.h
Generated by
1.18.0