uLib  User mode C/C++ extended API library for Win32 programmers.
InputEmu.h
Go to the documentation of this file.
1 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 // Project: uLib - User mode utility library.
3 // Module: Keyboard and mouse input emulation (SendInput simplifiers).
4 // Author: Copyright (c) Love Nystrom
5 // License: NNOSL (BSD descendant, see NNOSL.txt in the base directory).
6 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 
8 #ifndef __InputEmu_h_incl__
9 #define __InputEmu_h_incl__
10 
11 #include <uLib/Common.h>
12 
13 //==---------------------------------------------------------------------------
20 //==---------------------------------------------------------------------------
22 
23 #define MAKE_HOTKEY( key,flags ) (WORD)(((flags) << 8) | key)
24 
26 
27 // Keyboard
28 
34 
35 void MakeKeyInput( INPUT* Inp, WORD vKey, DWORD Flags );
36 
45 
46 UINT SendKeyInput( WORD vKey, DWORD Flags DEF_(0) );
47 
50 
51 bool SendKeyPress( WORD vKey );
52 
54 
55 bool SendHotKey( WORD Hotkey );
56 
57 // Mouse
58 
65 
66 void MakeMouseInput( INPUT* Inp, LONG dx, LONG dy, LONG data, DWORD Flags );
67 
71 
72 UINT SendMouseInput( LONG dx, LONG dy, LONG data, DWORD Flags );
73 
75 
76 typedef enum _mouse_key {
77  LBUTTON = _BV(0),
78  MBUTTON = _BV(1),
79  RBUTTON = _BV(2)
80 } MOUSEKEY;
81 
83 
84 bool SendMouseClick( MOUSEKEY Key );
85 
88 #endif//ndef __InputEmu_h_incl__
89 // EOF
unsigned long DWORD
Definition: Common.h:414
void MakeKeyInput(INPUT *Inp, WORD vKey, DWORD Flags)
Definition: InputEmu.cpp:15
unsigned short WORD
Definition: Common.h:413
UINT SendMouseInput(LONG dx, LONG dy, LONG data, DWORD Flags)
Definition: InputEmu.cpp:119
#define _BV(bitNr)
Definition: Common.h:1023
bool SendHotKey(WORD Hotkey)
Definition: InputEmu.cpp:43
bool SendMouseClick(MOUSEKEY Key)
Definition: InputEmu.cpp:128
void MakeMouseInput(INPUT *Inp, LONG dx, LONG dy, LONG data, DWORD Flags)
Definition: InputEmu.cpp:108
UINT SendKeyInput(WORD vKey, DWORD Flags=0)
Definition: InputEmu.cpp:26
MOUSEKEY
Definition: InputEmu.h:76
#define DEF_(x)
Definition: Common.h:240
Common include; Added types, small "ubiquitous" utilities, et c.
#define END_EXTERN_C
Definition: Common.h:221
#define BEGIN_EXTERN_C
Definition: Common.h:220
bool SendKeyPress(WORD vKey)
Definition: InputEmu.cpp:34