-
Notifications
You must be signed in to change notification settings - Fork 0
/
xinput_defs.h
125 lines (105 loc) · 3.3 KB
/
xinput_defs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#pragma once
#include <windef.h>
typedef struct _XINPUT_GAMEPAD {
WORD wButtons;
BYTE bLeftTrigger;
BYTE bRightTrigger;
SHORT sThumbLX;
SHORT sThumbLY;
SHORT sThumbRX;
SHORT sThumbRY;
} XINPUT_GAMEPAD, *PXINPUT_GAMEPAD;
typedef struct _XINPUT_GAMEPAD_EX {
WORD wButtons;
BYTE bLeftTrigger;
BYTE bRightTrigger;
SHORT sThumbLX;
SHORT sThumbLY;
SHORT sThumbRX;
SHORT sThumbRY;
DWORD dwUnknown;
} XINPUT_GAMEPAD_EX, *PXINPUT_GAMEPAD_EX;
typedef struct _XINPUT_STATE {
DWORD dwPacketNumber;
XINPUT_GAMEPAD Gamepad;
} XINPUT_STATE, *PXINPUT_STATE;
typedef struct _XINPUT_STATE_EX {
DWORD dwPacketNumber;
XINPUT_GAMEPAD_EX Gamepad;
} XINPUT_STATE_EX, *PXINPUT_STATE_EX;
typedef struct _XINPUT_VIBRATION {
WORD wLeftMotorSpeed;
WORD wRightMotorSpeed;
} XINPUT_VIBRATION, *PXINPUT_VIBRATION;
typedef struct _XINPUT_CAPABILITIES {
BYTE Type;
BYTE SubType;
WORD Flags;
XINPUT_GAMEPAD Gamepad;
XINPUT_VIBRATION Vibration;
} XINPUT_CAPABILITIES, *PXINPUT_CAPABILITIES;
typedef struct _XINPUT_BATTERY_INFORMATION {
BYTE BatteryType;
BYTE BatteryLevel;
} XINPUT_BATTERY_INFORMATION, *PXINPUT_BATTERY_INFORMATION;
typedef struct _XINPUT_KEYSTROKE {
WORD VirtualKey;
WCHAR Unicode;
WORD Flags;
BYTE UserIndex;
BYTE HidCode;
} XINPUT_KEYSTROKE, *PXINPUT_KEYSTROKE;
typedef struct _XINPUT_CAPABILITIES_EX {
XINPUT_CAPABILITIES Capabilities;
WORD VendorId;
WORD ProductId;
WORD ProductVersion;
WORD unk1;
DWORD unk2;
} XINPUT_CAPABILITIES_EX, *PXINPUT_CAPABILITIES_EX;
using XInputGetState_pfn = DWORD (WINAPI *)(
_In_ DWORD dwUserIndex,
_Out_ XINPUT_STATE *pState
);
using XInputGetStateEx_pfn = DWORD (WINAPI *)(
_In_ DWORD dwUserIndex,
_Out_ XINPUT_STATE_EX *pState
);
using XInputSetState_pfn = DWORD (WINAPI *)(
_In_ DWORD dwUserIndex,
_Inout_ XINPUT_VIBRATION *pVibration
);
using XInputGetCapabilities_pfn = DWORD (WINAPI *)(
_In_ DWORD dwUserIndex,
_In_ DWORD dwFlags,
_Out_ XINPUT_CAPABILITIES *pCapabilities
);
using XInputGetCapabilitiesEx_pfn = DWORD (WINAPI *)(
_In_ DWORD dwReserved,
_In_ DWORD dwUserIndex,
_In_ DWORD dwFlags,
_Out_ XINPUT_CAPABILITIES_EX *pCapabilitiesEx
);
using XInputGetBatteryInformation_pfn = DWORD (WINAPI *)(
_In_ DWORD dwUserIndex,
_In_ BYTE devType,
_Out_ XINPUT_BATTERY_INFORMATION *pBatteryInformation
);
using XInputGetKeystroke_pfn = DWORD (WINAPI *)(
DWORD dwUserIndex,
DWORD dwReserved,
PXINPUT_KEYSTROKE pKeystroke
);
using XInputEnable_pfn = void (WINAPI *)(
_In_ BOOL enable
);
using XInputPowerOff_pfn = DWORD (WINAPI *)(
_In_ DWORD dwUserIndex
);
#define XINPUT_GETSTATE_ORDINAL MAKEINTRESOURCEA (002)
#define XINPUT_SETSTATE_ORDINAL MAKEINTRESOURCEA (003)
#define XINPUT_GETCAPABILITIES_ORDINAL MAKEINTRESOURCEA (004)
#define XINPUT_ENABLE_ORDINAL MAKEINTRESOURCEA (005)
#define XINPUT_GETSTATEEX_ORDINAL MAKEINTRESOURCEA (100)
#define XINPUT_POWEROFF_ORDINAL MAKEINTRESOURCEA (103)
#define XINPUT_GETCAPABILITIES_EX_ORDINAL MAKEINTRESOURCEA (108)