mirror of
https://github.com/debauchee/barrier.git
synced 2024-12-24 19:42:24 +03:00
a16e7217ce
motion events relative to the previous mouse position. for example, if two mouse events arrive, the first at x+1,y and the second at x+2,y, we used to compute deltas of 1,0 and 2,0 instead of 1,0 and 1,0. that's fixed. also worked around a bug (probably) in windows that caused a motion event after a SetCursorPos() to be lost or reported one pixel off from the correct position. now using mouse_event() which doesn't have that problem. also fixed calculation of normalized coordinates for mouse_event() when there are multiple displays.
44 lines
1.2 KiB
C
44 lines
1.2 KiB
C
#ifndef CSYNERGYHOOK_H
|
|
#define CSYNERGYHOOK_H
|
|
|
|
#include "BasicTypes.h"
|
|
|
|
#if WINDOWS_LIKE
|
|
#define WIN32_LEAN_AND_MEAN
|
|
#include <windows.h>
|
|
#else
|
|
#error CSynergyHook is a win32 specific file
|
|
#endif
|
|
|
|
#if defined(SYNRGYHK_EXPORTS)
|
|
#define CSYNERGYHOOK_API __declspec(dllexport)
|
|
#else
|
|
#define CSYNERGYHOOK_API __declspec(dllimport)
|
|
#endif
|
|
|
|
#define SYNERGY_MSG_MARK WM_APP + 0x0011 // mark id; <unused>
|
|
#define SYNERGY_MSG_KEY WM_APP + 0x0012 // vk code; key data
|
|
#define SYNERGY_MSG_MOUSE_BUTTON WM_APP + 0x0013 // button msg; <unused>
|
|
#define SYNERGY_MSG_MOUSE_MOVE WM_APP + 0x0014 // x; y
|
|
#define SYNERGY_MSG_POST_WARP WM_APP + 0x0015 // x; y
|
|
#define SYNERGY_MSG_MOUSE_WHEEL WM_APP + 0x0016 // delta; <unused>
|
|
|
|
extern "C" {
|
|
|
|
typedef int (*InstallFunc)(DWORD targetQueueThreadID);
|
|
typedef int (*UninstallFunc)(void);
|
|
typedef void (*SetZoneFunc)(UInt32,
|
|
SInt32, SInt32, SInt32, SInt32, SInt32);
|
|
typedef void (*SetRelayFunc)(void);
|
|
|
|
CSYNERGYHOOK_API int install(DWORD);
|
|
CSYNERGYHOOK_API int uninstall(void);
|
|
CSYNERGYHOOK_API void setZone(UInt32 sides,
|
|
SInt32 x, SInt32 y, SInt32 w, SInt32 h,
|
|
SInt32 jumpZoneSize);
|
|
CSYNERGYHOOK_API void setRelay(void);
|
|
|
|
}
|
|
|
|
#endif
|