Added LGPL standard comment, and copyright notices where necessary.
[wine/multimedia.git] / include / dinput.h
blobd8ce8d15cf21150d3b845591250dfe64cf9d5ef6
1 /*
2 * Copyright (C) the Wine project
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #ifndef __WINE_DINPUT_H
20 #define __WINE_DINPUT_H
22 #include "windef.h" /* for MAX_PATH */
23 #include "unknwn.h"
25 #define DIRECTINPUT_VERSION 0x0500
27 /* Classes */
28 DEFINE_GUID(CLSID_DirectInput, 0x25E609E0,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
29 DEFINE_GUID(CLSID_DirectInputDevice, 0x25E609E1,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
31 /* Interfaces */
32 DEFINE_GUID(IID_IDirectInputA, 0x89521360,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
33 DEFINE_GUID(IID_IDirectInputW, 0x89521361,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
34 DEFINE_GUID(IID_IDirectInput2A, 0x5944E662,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
35 DEFINE_GUID(IID_IDirectInput2W, 0x5944E663,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
36 DEFINE_GUID(IID_IDirectInput7A, 0x9A4CB684,0x236D,0x11D3,0x8E,0x9D,0x00,0xC0,0x4F,0x68,0x44,0xAE);
37 DEFINE_GUID(IID_IDirectInput7W, 0x9A4CB685,0x236D,0x11D3,0x8E,0x9D,0x00,0xC0,0x4F,0x68,0x44,0xAE);
38 DEFINE_GUID(IID_IDirectInputDeviceA, 0x5944E680,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
39 DEFINE_GUID(IID_IDirectInputDeviceW, 0x5944E681,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
40 DEFINE_GUID(IID_IDirectInputDevice2A, 0x5944E682,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
41 DEFINE_GUID(IID_IDirectInputDevice2W, 0x5944E683,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
42 DEFINE_GUID(IID_IDirectInputDevice7A, 0x57D7C6BC,0x2356,0x11D3,0x8E,0x9D,0x00,0xC0,0x4F,0x68,0x44,0xAE);
43 DEFINE_GUID(IID_IDirectInputDevice7W, 0x57D7C6BD,0x2356,0x11D3,0x8E,0x9D,0x00,0xC0,0x4F,0x68,0x44,0xAE);
44 DEFINE_GUID(IID_IDirectInputEffect, 0xE7E1F7C0,0x88D2,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
46 /* Predefined object types */
47 DEFINE_GUID(GUID_XAxis, 0xA36D02E0,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
48 DEFINE_GUID(GUID_YAxis, 0xA36D02E1,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
49 DEFINE_GUID(GUID_ZAxis, 0xA36D02E2,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
50 DEFINE_GUID(GUID_RxAxis,0xA36D02F4,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
51 DEFINE_GUID(GUID_RyAxis,0xA36D02F5,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
52 DEFINE_GUID(GUID_RzAxis,0xA36D02E3,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
53 DEFINE_GUID(GUID_Slider,0xA36D02E4,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
54 DEFINE_GUID(GUID_Button,0xA36D02F0,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
55 DEFINE_GUID(GUID_Key, 0x55728220,0xD33C,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
56 DEFINE_GUID(GUID_POV, 0xA36D02F2,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
57 DEFINE_GUID(GUID_Unknown,0xA36D02F3,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
59 /* Predefined product GUIDs */
60 DEFINE_GUID(GUID_SysMouse, 0x6F1D2B60,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
61 DEFINE_GUID(GUID_SysKeyboard, 0x6F1D2B61,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
62 DEFINE_GUID(GUID_Joystick, 0x6F1D2B70,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
64 /* predefined forcefeedback effects */
65 DEFINE_GUID(GUID_ConstantForce, 0x13541C20,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
66 DEFINE_GUID(GUID_RampForce, 0x13541C21,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
67 DEFINE_GUID(GUID_Square, 0x13541C22,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
68 DEFINE_GUID(GUID_Sine, 0x13541C23,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
69 DEFINE_GUID(GUID_Triangle, 0x13541C24,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
70 DEFINE_GUID(GUID_SawtoothUp, 0x13541C25,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
71 DEFINE_GUID(GUID_SawtoothDown, 0x13541C26,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
72 DEFINE_GUID(GUID_Spring, 0x13541C27,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
73 DEFINE_GUID(GUID_Damper, 0x13541C28,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
74 DEFINE_GUID(GUID_Inertia, 0x13541C29,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
75 DEFINE_GUID(GUID_Friction, 0x13541C2A,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
76 DEFINE_GUID(GUID_CustomForce, 0x13541C2B,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
78 typedef struct IDirectInputA IDirectInputA,*LPDIRECTINPUTA;
79 typedef struct IDirectInput2A IDirectInput2A,*LPDIRECTINPUT2A;
80 typedef struct IDirectInput7A IDirectInput7A,*LPDIRECTINPUT7A;
81 typedef struct IDirectInputDeviceA IDirectInputDeviceA,*LPDIRECTINPUTDEVICEA;
82 typedef struct IDirectInputDevice2A IDirectInputDevice2A,*LPDIRECTINPUTDEVICE2A;
83 typedef struct IDirectInputDevice7A IDirectInputDevice7A,*LPDIRECTINPUTDEVICE7A;
84 typedef struct IDirectInputEffect IDirectInputEffect,*LPDIRECTINPUTEFFECT;
85 typedef struct SysKeyboardA SysKeyboardA,*LPSYSKEYBOARDA;
86 typedef struct SysMouseA SysMouseA,*LPSYSMOUSEA;
88 #define IID_IDirectInput WINELIB_NAME_AW(IID_IDirectInput)
89 DECL_WINELIB_TYPE_AW(LPDIRECTINPUT)
90 #define IID_IDirectInput7 WINELIB_NAME_AW(IID_IDirectInput7)
91 DECL_WINELIB_TYPE_AW(LPDIRECTINPUT7)
92 #define IID_IDirectInputDevice WINELIB_NAME_AW(IID_IDirectInputDevice)
93 DECL_WINELIB_TYPE_AW(LPDIRECTINPUTDEVICE)
94 #define IID_IDirectInputDevice2 WINELIB_NAME_AW(IID_IDirectInputDevice2)
95 DECL_WINELIB_TYPE_AW(LPDIRECTINPUTDEVICE2)
97 #define DI_OK S_OK
98 #define DI_NOTATTACHED S_FALSE
99 #define DI_BUFFEROVERFLOW S_FALSE
100 #define DI_PROPNOEFFECT S_FALSE
101 #define DI_NOEFFECT S_FALSE
102 #define DI_POLLEDDEVICE ((HRESULT)0x00000002L)
103 #define DI_DOWNLOADSKIPPED ((HRESULT)0x00000003L)
104 #define DI_EFFECTRESTARTED ((HRESULT)0x00000004L)
105 #define DI_TRUNCATED ((HRESULT)0x00000008L)
106 #define DI_TRUNCATEDANDRESTARTED ((HRESULT)0x0000000CL)
108 #define DIERR_OLDDIRECTINPUTVERSION \
109 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_OLD_WIN_VERSION)
110 #define DIERR_BETADIRECTINPUTVERSION \
111 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_RMODE_APP)
112 #define DIERR_BADDRIVERVER \
113 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_BAD_DRIVER_LEVEL)
114 #define DIERR_DEVICENOTREG REGDB_E_CLASSNOTREG
115 #define DIERR_NOTFOUND \
116 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_FILE_NOT_FOUND)
117 #define DIERR_OBJECTNOTFOUND \
118 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_FILE_NOT_FOUND)
119 #define DIERR_INVALIDPARAM E_INVALIDARG
120 #define DIERR_NOINTERFACE E_NOINTERFACE
121 #define DIERR_GENERIC E_FAIL
122 #define DIERR_OUTOFMEMORY E_OUTOFMEMORY
123 #define DIERR_UNSUPPORTED E_NOTIMPL
124 #define DIERR_NOTINITIALIZED \
125 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_NOT_READY)
126 #define DIERR_ALREADYINITIALIZED \
127 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_ALREADY_INITIALIZED)
128 #define DIERR_NOAGGREGATION CLASS_E_NOAGGREGATION
129 #define DIERR_OTHERAPPHASPRIO E_ACCESSDENIED
130 #define DIERR_INPUTLOST \
131 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_READ_FAULT)
132 #define DIERR_ACQUIRED \
133 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_BUSY)
134 #define DIERR_NOTACQUIRED \
135 MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_INVALID_ACCESS)
136 #define DIERR_READONLY E_ACCESSDENIED
137 #define DIERR_HANDLEEXISTS E_ACCESSDENIED
138 #ifndef E_PENDING
139 #define E_PENDING 0x8000000AL
140 #endif
141 #define DIERR_INSUFFICIENTPRIVS 0x80040200L
142 #define DIERR_DEVICEFULL 0x80040201L
143 #define DIERR_MOREDATA 0x80040202L
144 #define DIERR_NOTDOWNLOADED 0x80040203L
145 #define DIERR_HASEFFECTS 0x80040204L
146 #define DIERR_NOTEXCLUSIVEACQUIRED 0x80040205L
147 #define DIERR_INCOMPLETEEFFECT 0x80040206L
148 #define DIERR_NOTBUFFERED 0x80040207L
149 #define DIERR_EFFECTPLAYING 0x80040208L
150 #define DIERR_UNPLUGGED 0x80040209L
151 #define DIERR_REPORTFULL 0x8004020AL
153 #define DIENUM_STOP 0
154 #define DIENUM_CONTINUE 1
156 #define DIEDFL_ALLDEVICES 0x00000000
157 #define DIEDFL_ATTACHEDONLY 0x00000000
158 #define DIEDFL_FORCEFEEDBACK 0x00000100
159 #define DIEDFL_INCLUDEALIASES 0x00010000
160 #define DIEDFL_INCLUDEPHANTOMS 0x00020000
162 #define DIDEVTYPE_DEVICE 1
163 #define DIDEVTYPE_MOUSE 2
164 #define DIDEVTYPE_KEYBOARD 3
165 #define DIDEVTYPE_JOYSTICK 4
166 #define DIDEVTYPE_HID 0x00010000
168 #define DIDEVTYPEMOUSE_UNKNOWN 1
169 #define DIDEVTYPEMOUSE_TRADITIONAL 2
170 #define DIDEVTYPEMOUSE_FINGERSTICK 3
171 #define DIDEVTYPEMOUSE_TOUCHPAD 4
172 #define DIDEVTYPEMOUSE_TRACKBALL 5
174 #define DIDEVTYPEKEYBOARD_UNKNOWN 0
175 #define DIDEVTYPEKEYBOARD_PCXT 1
176 #define DIDEVTYPEKEYBOARD_OLIVETTI 2
177 #define DIDEVTYPEKEYBOARD_PCAT 3
178 #define DIDEVTYPEKEYBOARD_PCENH 4
179 #define DIDEVTYPEKEYBOARD_NOKIA1050 5
180 #define DIDEVTYPEKEYBOARD_NOKIA9140 6
181 #define DIDEVTYPEKEYBOARD_NEC98 7
182 #define DIDEVTYPEKEYBOARD_NEC98LAPTOP 8
183 #define DIDEVTYPEKEYBOARD_NEC98106 9
184 #define DIDEVTYPEKEYBOARD_JAPAN106 10
185 #define DIDEVTYPEKEYBOARD_JAPANAX 11
186 #define DIDEVTYPEKEYBOARD_J3100 12
188 #define DIDEVTYPEJOYSTICK_UNKNOWN 1
189 #define DIDEVTYPEJOYSTICK_TRADITIONAL 2
190 #define DIDEVTYPEJOYSTICK_FLIGHTSTICK 3
191 #define DIDEVTYPEJOYSTICK_GAMEPAD 4
192 #define DIDEVTYPEJOYSTICK_RUDDER 5
193 #define DIDEVTYPEJOYSTICK_WHEEL 6
194 #define DIDEVTYPEJOYSTICK_HEADTRACKER 7
196 #define GET_DIDEVICE_TYPE(dwDevType) LOBYTE(dwDevType)
197 #define GET_DIDEVICE_SUBTYPE(dwDevType) HIBYTE(dwDevType)
199 typedef struct {
200 DWORD dwSize;
201 GUID guidType;
202 DWORD dwOfs;
203 DWORD dwType;
204 DWORD dwFlags;
205 CHAR tszName[MAX_PATH];
206 #if(DIRECTINPUT_VERSION >= 0x0500)
207 DWORD dwFFMaxForce;
208 DWORD dwFFForceResolution;
209 WORD wCollectionNumber;
210 WORD wDesignatorIndex;
211 WORD wUsagePage;
212 WORD wUsage;
213 DWORD dwDimension;
214 WORD wExponent;
215 WORD wReserved;
216 #endif /* DIRECTINPUT_VERSION >= 0x0500 */
217 } DIDEVICEOBJECTINSTANCEA, *LPDIDEVICEOBJECTINSTANCEA,*LPCDIDEVICEOBJECTINSTANCEA;
219 typedef struct {
220 DWORD dwSize;
221 GUID guidType;
222 DWORD dwOfs;
223 DWORD dwType;
224 DWORD dwFlags;
225 WCHAR tszName[MAX_PATH];
226 #if(DIRECTINPUT_VERSION >= 0x0500)
227 DWORD dwFFMaxForce;
228 DWORD dwFFForceResolution;
229 WORD wCollectionNumber;
230 WORD wDesignatorIndex;
231 WORD wUsagePage;
232 WORD wUsage;
233 DWORD dwDimension;
234 WORD wExponent;
235 WORD wReserved;
236 #endif /* DIRECTINPUT_VERSION >= 0x0500 */
237 } DIDEVICEOBJECTINSTANCEW, *LPDIDEVICEOBJECTINSTANCEW,*LPCDIDEVICEOBJECTINSTANCEW;
238 DECL_WINELIB_TYPE_AW(LPDIDEVICEOBJECTINSTANCE)
239 DECL_WINELIB_TYPE_AW(DIDEVICEOBJECTINSTANCE)
242 typedef struct {
243 DWORD dwSize;
244 GUID guidInstance;
245 GUID guidProduct;
246 DWORD dwDevType;
247 CHAR tszInstanceName[MAX_PATH];
248 CHAR tszProductName[MAX_PATH];
249 #if(DIRECTINPUT_VERSION >= 0x0500)
250 GUID guidFFDriver;
251 WORD wUsagePage;
252 WORD wUsage;
253 #endif /* DIRECTINPUT_VERSION >= 0x0500 */
254 } DIDEVICEINSTANCEA, *LPDIDEVICEINSTANCEA, *LPCDIDEVICEINSTANCEA;
256 typedef struct {
257 DWORD dwSize;
258 GUID guidInstance;
259 GUID guidProduct;
260 DWORD dwDevType;
261 WCHAR tszInstanceName[MAX_PATH];
262 WCHAR tszProductName[MAX_PATH];
263 #if(DIRECTINPUT_VERSION >= 0x0500)
264 GUID guidFFDriver;
265 WORD wUsagePage;
266 WORD wUsage;
267 #endif /* DIRECTINPUT_VERSION >= 0x0500 */
268 } DIDEVICEINSTANCEW, *LPDIDEVICEINSTANCEW, *LPCDIDEVICEINSTANCEW;
269 DECL_WINELIB_TYPE_AW(DIDEVICEINSTANCE)
270 DECL_WINELIB_TYPE_AW(LPDIDEVICEINSTANCE)
271 DECL_WINELIB_TYPE_AW(LPCDIDEVICEINSTANCE)
273 typedef BOOL (CALLBACK *LPDIENUMDEVICESCALLBACKA)(LPCDIDEVICEINSTANCEA,LPVOID);
274 typedef BOOL (CALLBACK *LPDIENUMDEVICESCALLBACKW)(LPCDIDEVICEINSTANCEW,LPVOID);
275 DECL_WINELIB_TYPE_AW(LPDIENUMDEVICESCALLBACK)
277 typedef BOOL (CALLBACK *LPDIENUMDEVICEOBJECTSCALLBACKA)(LPCDIDEVICEOBJECTINSTANCEA, LPVOID);
278 typedef BOOL (CALLBACK *LPDIENUMDEVICEOBJECTSCALLBACKW)(LPCDIDEVICEOBJECTINSTANCEW,LPVOID);
279 DECL_WINELIB_TYPE_AW(LPDIENUMDEVICEOBJECTSCALLBACK)
281 typedef BOOL (CALLBACK *LPDIENUMCREATEDEFFECTOBJECTSCALLBACK)(LPDIRECTINPUTEFFECT, LPVOID);
283 #define DIK_ESCAPE 0x01
284 #define DIK_1 0x02
285 #define DIK_2 0x03
286 #define DIK_3 0x04
287 #define DIK_4 0x05
288 #define DIK_5 0x06
289 #define DIK_6 0x07
290 #define DIK_7 0x08
291 #define DIK_8 0x09
292 #define DIK_9 0x0A
293 #define DIK_0 0x0B
294 #define DIK_MINUS 0x0C /* - on main keyboard */
295 #define DIK_EQUALS 0x0D
296 #define DIK_BACK 0x0E /* backspace */
297 #define DIK_TAB 0x0F
298 #define DIK_Q 0x10
299 #define DIK_W 0x11
300 #define DIK_E 0x12
301 #define DIK_R 0x13
302 #define DIK_T 0x14
303 #define DIK_Y 0x15
304 #define DIK_U 0x16
305 #define DIK_I 0x17
306 #define DIK_O 0x18
307 #define DIK_P 0x19
308 #define DIK_LBRACKET 0x1A
309 #define DIK_RBRACKET 0x1B
310 #define DIK_RETURN 0x1C /* Enter on main keyboard */
311 #define DIK_LCONTROL 0x1D
312 #define DIK_A 0x1E
313 #define DIK_S 0x1F
314 #define DIK_D 0x20
315 #define DIK_F 0x21
316 #define DIK_G 0x22
317 #define DIK_H 0x23
318 #define DIK_J 0x24
319 #define DIK_K 0x25
320 #define DIK_L 0x26
321 #define DIK_SEMICOLON 0x27
322 #define DIK_APOSTROPHE 0x28
323 #define DIK_GRAVE 0x29 /* accent grave */
324 #define DIK_LSHIFT 0x2A
325 #define DIK_BACKSLASH 0x2B
326 #define DIK_Z 0x2C
327 #define DIK_X 0x2D
328 #define DIK_C 0x2E
329 #define DIK_V 0x2F
330 #define DIK_B 0x30
331 #define DIK_N 0x31
332 #define DIK_M 0x32
333 #define DIK_COMMA 0x33
334 #define DIK_PERIOD 0x34 /* . on main keyboard */
335 #define DIK_SLASH 0x35 /* / on main keyboard */
336 #define DIK_RSHIFT 0x36
337 #define DIK_MULTIPLY 0x37 /* * on numeric keypad */
338 #define DIK_LMENU 0x38 /* left Alt */
339 #define DIK_SPACE 0x39
340 #define DIK_CAPITAL 0x3A
341 #define DIK_F1 0x3B
342 #define DIK_F2 0x3C
343 #define DIK_F3 0x3D
344 #define DIK_F4 0x3E
345 #define DIK_F5 0x3F
346 #define DIK_F6 0x40
347 #define DIK_F7 0x41
348 #define DIK_F8 0x42
349 #define DIK_F9 0x43
350 #define DIK_F10 0x44
351 #define DIK_NUMLOCK 0x45
352 #define DIK_SCROLL 0x46 /* Scroll Lock */
353 #define DIK_NUMPAD7 0x47
354 #define DIK_NUMPAD8 0x48
355 #define DIK_NUMPAD9 0x49
356 #define DIK_SUBTRACT 0x4A /* - on numeric keypad */
357 #define DIK_NUMPAD4 0x4B
358 #define DIK_NUMPAD5 0x4C
359 #define DIK_NUMPAD6 0x4D
360 #define DIK_ADD 0x4E /* + on numeric keypad */
361 #define DIK_NUMPAD1 0x4F
362 #define DIK_NUMPAD2 0x50
363 #define DIK_NUMPAD3 0x51
364 #define DIK_NUMPAD0 0x52
365 #define DIK_DECIMAL 0x53 /* . on numeric keypad */
366 #define DIK_F11 0x57
367 #define DIK_F12 0x58
368 #define DIK_F13 0x64 /* (NEC PC98) */
369 #define DIK_F14 0x65 /* (NEC PC98) */
370 #define DIK_F15 0x66 /* (NEC PC98) */
371 #define DIK_KANA 0x70 /* (Japanese keyboard) */
372 #define DIK_CONVERT 0x79 /* (Japanese keyboard) */
373 #define DIK_NOCONVERT 0x7B /* (Japanese keyboard) */
374 #define DIK_YEN 0x7D /* (Japanese keyboard) */
375 #define DIK_NUMPADEQUALS 0x8D /* = on numeric keypad (NEC PC98) */
376 #define DIK_CIRCUMFLEX 0x90 /* (Japanese keyboard) */
377 #define DIK_AT 0x91 /* (NEC PC98) */
378 #define DIK_COLON 0x92 /* (NEC PC98) */
379 #define DIK_UNDERLINE 0x93 /* (NEC PC98) */
380 #define DIK_KANJI 0x94 /* (Japanese keyboard) */
381 #define DIK_STOP 0x95 /* (NEC PC98) */
382 #define DIK_AX 0x96 /* (Japan AX) */
383 #define DIK_UNLABELED 0x97 /* (J3100) */
384 #define DIK_NUMPADENTER 0x9C /* Enter on numeric keypad */
385 #define DIK_RCONTROL 0x9D
386 #define DIK_NUMPADCOMMA 0xB3 /* , on numeric keypad (NEC PC98) */
387 #define DIK_DIVIDE 0xB5 /* / on numeric keypad */
388 #define DIK_SYSRQ 0xB7
389 #define DIK_RMENU 0xB8 /* right Alt */
390 #define DIK_PAUSE 0xC5 /* Pause */
391 #define DIK_HOME 0xC7 /* Home on arrow keypad */
392 #define DIK_UP 0xC8 /* UpArrow on arrow keypad */
393 #define DIK_PRIOR 0xC9 /* PgUp on arrow keypad */
394 #define DIK_LEFT 0xCB /* LeftArrow on arrow keypad */
395 #define DIK_RIGHT 0xCD /* RightArrow on arrow keypad */
396 #define DIK_END 0xCF /* End on arrow keypad */
397 #define DIK_DOWN 0xD0 /* DownArrow on arrow keypad */
398 #define DIK_NEXT 0xD1 /* PgDn on arrow keypad */
399 #define DIK_INSERT 0xD2 /* Insert on arrow keypad */
400 #define DIK_DELETE 0xD3 /* Delete on arrow keypad */
401 #define DIK_LWIN 0xDB /* Left Windows key */
402 #define DIK_RWIN 0xDC /* Right Windows key */
403 #define DIK_APPS 0xDD /* AppMenu key */
404 #define DIK_POWER 0xDE
405 #define DIK_SLEEP 0xDF
406 #define DIK_BACKSPACE DIK_BACK /* backspace */
407 #define DIK_NUMPADSTAR DIK_MULTIPLY /* * on numeric keypad */
408 #define DIK_LALT DIK_LMENU /* left Alt */
409 #define DIK_CAPSLOCK DIK_CAPITAL /* CapsLock */
410 #define DIK_NUMPADMINUS DIK_SUBTRACT /* - on numeric keypad */
411 #define DIK_NUMPADPLUS DIK_ADD /* + on numeric keypad */
412 #define DIK_NUMPADPERIOD DIK_DECIMAL /* . on numeric keypad */
413 #define DIK_NUMPADSLASH DIK_DIVIDE /* / on numeric keypad */
414 #define DIK_RALT DIK_RMENU /* right Alt */
415 #define DIK_UPARROW DIK_UP /* UpArrow on arrow keypad */
416 #define DIK_PGUP DIK_PRIOR /* PgUp on arrow keypad */
417 #define DIK_LEFTARROW DIK_LEFT /* LeftArrow on arrow keypad */
418 #define DIK_RIGHTARROW DIK_RIGHT /* RightArrow on arrow keypad */
419 #define DIK_DOWNARROW DIK_DOWN /* DownArrow on arrow keypad */
420 #define DIK_PGDN DIK_NEXT /* PgDn on arrow keypad */
422 #define DIDFT_ALL 0x00000000
423 #define DIDFT_RELAXIS 0x00000001
424 #define DIDFT_ABSAXIS 0x00000002
425 #define DIDFT_AXIS 0x00000003
426 #define DIDFT_PSHBUTTON 0x00000004
427 #define DIDFT_TGLBUTTON 0x00000008
428 #define DIDFT_BUTTON 0x0000000C
429 #define DIDFT_POV 0x00000010
430 #define DIDFT_COLLECTION 0x00000040
431 #define DIDFT_NODATA 0x00000080
432 #define DIDFT_ANYINSTANCE 0x00FFFF00
433 #define DIDFT_INSTANCEMASK DIDFT_ANYINSTANCE
434 #define DIDFT_MAKEINSTANCE(n) ((WORD)(n) << 8)
435 #define DIDFT_GETTYPE(n) LOBYTE(n)
436 #define DIDFT_GETINSTANCE(n) LOWORD((n) >> 8)
437 #define DIDFT_FFACTUATOR 0x01000000
438 #define DIDFT_FFEFFECTTRIGGER 0x02000000
439 #define DIDFT_OUTPUT 0x10000000
440 #define DIDFT_ENUMCOLLECTION(n) ((WORD)(n) << 8)
441 #define DIDFT_NOCOLLECTION 0x00FFFF00
442 #define DIDF_ABSAXIS 0x00000001
443 #define DIDF_RELAXIS 0x00000002
445 #define DIGDD_PEEK 0x00000001
447 typedef struct DIDEVICEOBJECTDATA {
448 DWORD dwOfs;
449 DWORD dwData;
450 DWORD dwTimeStamp;
451 DWORD dwSequence;
452 } DIDEVICEOBJECTDATA,*LPDIDEVICEOBJECTDATA,*LPCDIDEVICEOBJECTDATA;
454 typedef struct _DIOBJECTDATAFORMAT {
455 const GUID *pguid;
456 DWORD dwOfs;
457 DWORD dwType;
458 DWORD dwFlags;
459 } DIOBJECTDATAFORMAT, *LPDIOBJECTDATAFORMAT;
461 typedef struct {
462 DWORD dwSize;
463 DWORD dwObjSize;
464 DWORD dwFlags;
465 DWORD dwDataSize;
466 DWORD dwNumObjs;
467 LPDIOBJECTDATAFORMAT rgodf;
468 } DIDATAFORMAT, *LPDIDATAFORMAT;
469 typedef const DIDATAFORMAT *LPCDIDATAFORMAT;
471 typedef struct {
472 DWORD dwSize;
473 DWORD dwHeaderSize;
474 DWORD dwObj;
475 DWORD dwHow;
476 } DIPROPHEADER,*LPDIPROPHEADER;
477 typedef const DIPROPHEADER *LPCDIPROPHEADER;
479 #define DIPH_DEVICE 0
480 #define DIPH_BYOFFSET 1
481 #define DIPH_BYID 2
482 #define DIPH_BYUSAGE 3
484 #define DIMAKEUSAGEDWORD(UsagePage, Usage) (DWORD)MAKELONG(Usage, UsagePage)
486 typedef struct DIPROPDWORD {
487 DIPROPHEADER diph;
488 DWORD dwData;
489 } DIPROPDWORD, *LPDIPROPDWORD;
490 typedef const DIPROPDWORD *LPCDIPROPDWORD;
492 typedef struct DIPROPRANGE {
493 DIPROPHEADER diph;
494 LONG lMin;
495 LONG lMax;
496 } DIPROPRANGE, *LPDIPROPRANGE;
497 typedef const DIPROPRANGE *LPCDIPROPRANGE;
499 #define DIPROPRANGE_NOMIN ((LONG)0x80000000)
500 #define DIPROPRANGE_NOMAX ((LONG)0x7FFFFFFF)
502 typedef struct DIPROPCAL {
503 DIPROPHEADER diph;
504 LONG lMin;
505 LONG lCenter;
506 LONG lMax;
507 } DIPROPCAL, *LPDIPROPCAL;
508 typedef const DIPROPCAL *LPCDIPROPCAL;
510 typedef struct DIPROPGUIDANDPATH {
511 DIPROPHEADER diph;
512 GUID guidClass;
513 WCHAR wszPath[MAX_PATH];
514 } DIPROPGUIDANDPATH, *LPDIPROPGUIDANDPATH,*LPCDIPROPGUIDANDPATH;
516 /* special property GUIDs */
517 #ifdef __cplusplus
518 #define MAKEDIPROP(prop) (*(const GUID *)(prop))
519 #else
520 #define MAKEDIPROP(prop) ((REFGUID)(prop))
521 #endif
522 #define DIPROP_BUFFERSIZE MAKEDIPROP(1)
523 #define DIPROP_AXISMODE MAKEDIPROP(2)
525 #define DIPROPAXISMODE_ABS 0
526 #define DIPROPAXISMODE_REL 1
528 #define DIPROP_GRANULARITY MAKEDIPROP(3)
529 #define DIPROP_RANGE MAKEDIPROP(4)
530 #define DIPROP_DEADZONE MAKEDIPROP(5)
531 #define DIPROP_SATURATION MAKEDIPROP(6)
532 #define DIPROP_FFGAIN MAKEDIPROP(7)
533 #define DIPROP_FFLOAD MAKEDIPROP(8)
534 #define DIPROP_AUTOCENTER MAKEDIPROP(9)
536 #define DIPROPAUTOCENTER_OFF 0
537 #define DIPROPAUTOCENTER_ON 1
539 #define DIPROP_CALIBRATIONMODE MAKEDIPROP(10)
541 #define DIPROPCALIBRATIONMODE_COOKED 0
542 #define DIPROPCALIBRATIONMODE_RAW 1
544 #define DIPROP_CALIBRATION MAKEDIPROP(11)
545 #define DIPROP_GUIDANDPATH MAKEDIPROP(12)
548 typedef struct DIDEVCAPS {
549 DWORD dwSize;
550 DWORD dwFlags;
551 DWORD dwDevType;
552 DWORD dwAxes;
553 DWORD dwButtons;
554 DWORD dwPOVs;
555 #if(DIRECTINPUT_VERSION >= 0x0500)
556 DWORD dwFFSamplePeriod;
557 DWORD dwFFMinTimeResolution;
558 DWORD dwFirmwareRevision;
559 DWORD dwHardwareRevision;
560 DWORD dwFFDriverVersion;
561 #endif /* DIRECTINPUT_VERSION >= 0x0500 */
562 } DIDEVCAPS,*LPDIDEVCAPS;
564 #define DIDC_ATTACHED 0x00000001
565 #define DIDC_POLLEDDEVICE 0x00000002
566 #define DIDC_EMULATED 0x00000004
567 #define DIDC_POLLEDDATAFORMAT 0x00000008
568 #define DIDC_FORCEFEEDBACK 0x00000100
569 #define DIDC_FFATTACK 0x00000200
570 #define DIDC_FFFADE 0x00000400
571 #define DIDC_SATURATION 0x00000800
572 #define DIDC_POSNEGCOEFFICIENTS 0x00001000
573 #define DIDC_POSNEGSATURATION 0x00002000
574 #define DIDC_DEADBAND 0x00004000
576 /* SetCooperativeLevel dwFlags */
577 #define DISCL_EXCLUSIVE 0x00000001
578 #define DISCL_NONEXCLUSIVE 0x00000002
579 #define DISCL_FOREGROUND 0x00000004
580 #define DISCL_BACKGROUND 0x00000008
582 typedef struct DICONSTANTFORCE {
583 LONG lMagnitude;
584 } DICONSTANTFORCE, *LPDICONSTANTFORCE;
586 typedef const DICONSTANTFORCE *LPCDICONSTANTFORCE;
588 typedef struct DIRAMPFORCE {
589 LONG lStart;
590 LONG lEnd;
591 } DIRAMPFORCE, *LPDIRAMPFORCE;
593 typedef const DIRAMPFORCE *LPCDIRAMPFORCE;
595 typedef struct DIPERIODIC {
596 DWORD dwMagnitude;
597 LONG lOffset;
598 DWORD dwPhase;
599 DWORD dwPeriod;
600 } DIPERIODIC, *LPDIPERIODIC;
602 typedef const DIPERIODIC *LPCDIPERIODIC;
604 typedef struct DICONDITION {
605 LONG lOffset;
606 LONG lPositiveCoefficient;
607 LONG lNegativeCoefficient;
608 DWORD dwPositiveSaturation;
609 DWORD dwNegativeSaturation;
610 LONG lDeadBand;
611 } DICONDITION, *LPDICONDITION;
613 typedef const DICONDITION *LPCDICONDITION;
615 typedef struct DICUSTOMFORCE {
616 DWORD cChannels;
617 DWORD dwSamplePeriod;
618 DWORD cSamples;
619 LPLONG rglForceData;
620 } DICUSTOMFORCE, *LPDICUSTOMFORCE;
622 typedef const DICUSTOMFORCE *LPCDICUSTOMFORCE;
624 typedef struct DIENVELOPE {
625 DWORD dwSize;
626 DWORD dwAttackLevel;
627 DWORD dwAttackTime;
628 DWORD dwFadeLevel;
629 DWORD dwFadeTime;
630 } DIENVELOPE, *LPDIENVELOPE;
632 typedef const DIENVELOPE *LPCDIENVELOPE;
634 typedef struct DIEFFECT {
635 DWORD dwSize;
636 DWORD dwFlags;
637 DWORD dwDuration;
638 DWORD dwSamplePeriod;
639 DWORD dwGain;
640 DWORD dwTriggerButton;
641 DWORD dwTriggerRepeatInterval;
642 DWORD cAxes;
643 LPDWORD rgdwAxes;
644 LPLONG rglDirection;
645 LPDIENVELOPE lpEnvelope;
646 DWORD cbTypeSpecificParams;
647 LPVOID lpvTypeSpecificParams;
648 } DIEFFECT, *LPDIEFFECT;
650 typedef const DIEFFECT *LPCDIEFFECT;
652 typedef struct DIEFFECTINFOA {
653 DWORD dwSize;
654 GUID guid;
655 DWORD dwEffType;
656 DWORD dwStaticParams;
657 DWORD dwDynamicParams;
658 CHAR tszName[MAX_PATH];
659 } DIEFFECTINFOA, *LPDIEFFECTINFOA;
661 typedef struct DIEFFECTINFOW {
662 DWORD dwSize;
663 GUID guid;
664 DWORD dwEffType;
665 DWORD dwStaticParams;
666 DWORD dwDynamicParams;
667 WCHAR tszName[MAX_PATH];
668 } DIEFFECTINFOW, *LPDIEFFECTINFOW;
670 #ifdef UNICODE
671 typedef DIEFFECTINFOW DIEFFECTINFO;
672 typedef LPDIEFFECTINFOW LPDIEFFECTINFO;
673 #else
674 typedef DIEFFECTINFOA DIEFFECTINFO;
675 typedef LPDIEFFECTINFOA LPDIEFFECTINFO;
676 #endif
678 typedef const DIEFFECTINFOA *LPCDIEFFECTINFOA;
679 typedef const DIEFFECTINFOW *LPCDIEFFECTINFOW;
680 typedef const DIEFFECTINFO *LPCDIEFFECTINFO;
682 typedef BOOL (CALLBACK *LPDIENUMEFFECTSCALLBACKA)(LPCDIEFFECTINFOA, LPVOID);
683 typedef BOOL (CALLBACK *LPDIENUMEFFECTSCALLBACKW)(LPCDIEFFECTINFOW, LPVOID);
685 typedef struct DIEFFESCAPE {
686 DWORD dwSize;
687 DWORD dwCommand;
688 LPVOID lpvInBuffer;
689 DWORD cbInBuffer;
690 LPVOID lpvOutBuffer;
691 DWORD cbOutBuffer;
692 } DIEFFESCAPE, *LPDIEFFESCAPE;
694 typedef struct DIJOYSTATE {
695 LONG lX;
696 LONG lY;
697 LONG lZ;
698 LONG lRx;
699 LONG lRy;
700 LONG lRz;
701 LONG rglSlider[2];
702 DWORD rgdwPOV[4];
703 BYTE rgbButtons[32];
704 } DIJOYSTATE, *LPDIJOYSTATE;
706 typedef struct DIJOYSTATE2 {
707 LONG lX;
708 LONG lY;
709 LONG lZ;
710 LONG lRx;
711 LONG lRy;
712 LONG lRz;
713 LONG rglSlider[2];
714 DWORD rgdwPOV[4];
715 BYTE rgbButtons[128];
716 LONG lVX; /* 'v' as in velocity */
717 LONG lVY;
718 LONG lVZ;
719 LONG lVRx;
720 LONG lVRy;
721 LONG lVRz;
722 LONG rglVSlider[2];
723 LONG lAX; /* 'a' as in acceleration */
724 LONG lAY;
725 LONG lAZ;
726 LONG lARx;
727 LONG lARy;
728 LONG lARz;
729 LONG rglASlider[2];
730 LONG lFX; /* 'f' as in force */
731 LONG lFY;
732 LONG lFZ;
733 LONG lFRx; /* 'fr' as in rotational force aka torque */
734 LONG lFRy;
735 LONG lFRz;
736 LONG rglFSlider[2];
737 } DIJOYSTATE2, *LPDIJOYSTATE2;
739 #define DIJOFS_X FIELD_OFFSET(DIJOYSTATE, lX)
740 #define DIJOFS_Y FIELD_OFFSET(DIJOYSTATE, lY)
741 #define DIJOFS_Z FIELD_OFFSET(DIJOYSTATE, lZ)
742 #define DIJOFS_RX FIELD_OFFSET(DIJOYSTATE, lRx)
743 #define DIJOFS_RY FIELD_OFFSET(DIJOYSTATE, lRy)
744 #define DIJOFS_RZ FIELD_OFFSET(DIJOYSTATE, lRz)
745 #define DIJOFS_SLIDER(n) (FIELD_OFFSET(DIJOYSTATE, rglSlider) + \
746 (n) * sizeof(LONG))
747 #define DIJOFS_POV(n) (FIELD_OFFSET(DIJOYSTATE, rgdwPOV) + \
748 (n) * sizeof(DWORD))
749 #define DIJOFS_BUTTON(n) (FIELD_OFFSET(DIJOYSTATE, rgbButtons) + (n))
750 #define DIJOFS_BUTTON0 DIJOFS_BUTTON(0)
751 #define DIJOFS_BUTTON1 DIJOFS_BUTTON(1)
752 #define DIJOFS_BUTTON2 DIJOFS_BUTTON(2)
753 #define DIJOFS_BUTTON3 DIJOFS_BUTTON(3)
754 #define DIJOFS_BUTTON4 DIJOFS_BUTTON(4)
755 #define DIJOFS_BUTTON5 DIJOFS_BUTTON(5)
756 #define DIJOFS_BUTTON6 DIJOFS_BUTTON(6)
757 #define DIJOFS_BUTTON7 DIJOFS_BUTTON(7)
758 #define DIJOFS_BUTTON8 DIJOFS_BUTTON(8)
759 #define DIJOFS_BUTTON9 DIJOFS_BUTTON(9)
760 #define DIJOFS_BUTTON10 DIJOFS_BUTTON(10)
761 #define DIJOFS_BUTTON11 DIJOFS_BUTTON(11)
762 #define DIJOFS_BUTTON12 DIJOFS_BUTTON(12)
763 #define DIJOFS_BUTTON13 DIJOFS_BUTTON(13)
764 #define DIJOFS_BUTTON14 DIJOFS_BUTTON(14)
765 #define DIJOFS_BUTTON15 DIJOFS_BUTTON(15)
766 #define DIJOFS_BUTTON16 DIJOFS_BUTTON(16)
767 #define DIJOFS_BUTTON17 DIJOFS_BUTTON(17)
768 #define DIJOFS_BUTTON18 DIJOFS_BUTTON(18)
769 #define DIJOFS_BUTTON19 DIJOFS_BUTTON(19)
770 #define DIJOFS_BUTTON20 DIJOFS_BUTTON(20)
771 #define DIJOFS_BUTTON21 DIJOFS_BUTTON(21)
772 #define DIJOFS_BUTTON22 DIJOFS_BUTTON(22)
773 #define DIJOFS_BUTTON23 DIJOFS_BUTTON(23)
774 #define DIJOFS_BUTTON24 DIJOFS_BUTTON(24)
775 #define DIJOFS_BUTTON25 DIJOFS_BUTTON(25)
776 #define DIJOFS_BUTTON26 DIJOFS_BUTTON(26)
777 #define DIJOFS_BUTTON27 DIJOFS_BUTTON(27)
778 #define DIJOFS_BUTTON28 DIJOFS_BUTTON(28)
779 #define DIJOFS_BUTTON29 DIJOFS_BUTTON(29)
780 #define DIJOFS_BUTTON30 DIJOFS_BUTTON(30)
781 #define DIJOFS_BUTTON31 DIJOFS_BUTTON(31)
783 /* DInput 7 structures, types */
784 typedef struct DIFILEEFFECT {
785 DWORD dwSize;
786 GUID GuidEffect;
787 LPCDIEFFECT lpDiEffect;
788 CHAR szFriendlyName[MAX_PATH];
789 } DIFILEEFFECT, *LPDIFILEEFFECT;
791 typedef const DIFILEEFFECT *LPCDIFILEEFFECT;
792 typedef BOOL (CALLBACK *LPDIENUMEFFECTSINFILECALLBACK)(LPCDIFILEEFFECT , LPVOID);
795 /*****************************************************************************
796 * IDirectInputEffect interface
798 #define ICOM_INTERFACE IDirectInputEffect
799 #define IDirectInputEffect_METHODS \
800 ICOM_METHOD3(HRESULT,Initialize, HINSTANCE,, DWORD,, REFGUID,) \
801 ICOM_METHOD1(HRESULT,GetEffectGuid, LPGUID,) \
802 ICOM_METHOD2(HRESULT,GetParameters, LPDIEFFECT,, DWORD,) \
803 ICOM_METHOD2(HRESULT,SetParameters, LPCDIEFFECT,, DWORD,) \
804 ICOM_METHOD2(HRESULT,Start, DWORD,, DWORD,) \
805 ICOM_METHOD (HRESULT,Stop) \
806 ICOM_METHOD1(HRESULT,GetEffectStatus, LPDWORD,) \
807 ICOM_METHOD (HRESULT,Download) \
808 ICOM_METHOD (HRESULT,Unload) \
809 ICOM_METHOD1(HRESULT,Escape, LPDIEFFESCAPE,)
810 #define IDirectInputEffect_IMETHODS \
811 IUnknown_IMETHODS \
812 IDirectInputEffect_METHODS
813 ICOM_DEFINE(IDirectInputEffect,IUnknown)
814 #undef ICOM_INTERFACE
816 /*** IUnknown methods ***/
817 #define IDirectInputEffect_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
818 #define IDirectInputEffect_AddRef(p) ICOM_CALL (AddRef,p)
819 #define IDirectInputEffect_Release(p) ICOM_CALL (Release,p)
820 /*** IDirectInputEffect methods ***/
821 #define IDirectInputEffect_Initialize(p,a,b,c) ICOM_CALL3(Initialize,p,a,b,c)
822 #define IDirectInputEffect_GetEffectGuid(p,a) ICOM_CALL1(GetEffectGuid,p,a)
823 #define IDirectInputEffect_GetParameters(p,a,b) ICOM_CALL2(GetParameters,p,a,b)
824 #define IDirectInputEffect_SetParameters(p,a,b) ICOM_CALL2(SetParameters,p,a,b)
825 #define IDirectInputEffect_Start(p,a,b) ICOM_CALL2(Start,p,a,b)
826 #define IDirectInputEffect_Stop(p) ICOM_CALL (Stop,p)
827 #define IDirectInputEffect_GetEffectStatus(p,a,b) ICOM_CALL1(GetEffectStatus,p,a)
828 #define IDirectInputEffect_Download(p) ICOM_CALL (Download,p)
829 #define IDirectInputEffect_Unload(p) ICOM_CALL (Unload,p)
830 #define IDirectInputEffect_Escape(p,a) ICOM_CALL1(Escape,p,a)
833 /*****************************************************************************
834 * IDirectInputDeviceA interface
836 #define ICOM_INTERFACE IDirectInputDeviceA
837 #define IDirectInputDeviceA_METHODS \
838 ICOM_METHOD1(HRESULT,GetCapabilities, LPDIDEVCAPS,lpDIDevCaps) \
839 ICOM_METHOD3(HRESULT,EnumObjects, LPDIENUMDEVICEOBJECTSCALLBACKA,lpCallback, LPVOID,pvRef, DWORD,dwFlags) \
840 ICOM_METHOD2(HRESULT,GetProperty, REFGUID,rguidProp, LPDIPROPHEADER,pdiph) \
841 ICOM_METHOD2(HRESULT,SetProperty, REFGUID,rguidProp, LPCDIPROPHEADER,pdiph) \
842 ICOM_METHOD (HRESULT,Acquire) \
843 ICOM_METHOD (HRESULT,Unacquire) \
844 ICOM_METHOD2(HRESULT,GetDeviceState, DWORD,cbData, LPVOID,lpvData) \
845 ICOM_METHOD4(HRESULT,GetDeviceData, DWORD,cbObjectData, LPDIDEVICEOBJECTDATA,rgdod, LPDWORD,pdwInOut, DWORD,dwFlags) \
846 ICOM_METHOD1(HRESULT,SetDataFormat, LPCDIDATAFORMAT,lpdf) \
847 ICOM_METHOD1(HRESULT,SetEventNotification, HANDLE,hEvent) \
848 ICOM_METHOD2(HRESULT,SetCooperativeLevel, HWND,hwnd, DWORD,dwFlags) \
849 ICOM_METHOD3(HRESULT,GetObjectInfo, LPDIDEVICEOBJECTINSTANCEA,pdidoi, DWORD,dwObj, DWORD,dwHow) \
850 ICOM_METHOD1(HRESULT,GetDeviceInfo, LPDIDEVICEINSTANCEA,pdidi) \
851 ICOM_METHOD2(HRESULT,RunControlPanel, HWND,hwndOwner, DWORD,dwFlags) \
852 ICOM_METHOD3(HRESULT,Initialize, HINSTANCE,hinst, DWORD,dwVersion, REFGUID,rguid)
853 #define IDirectInputDeviceA_IMETHODS \
854 IUnknown_IMETHODS \
855 IDirectInputDeviceA_METHODS
856 ICOM_DEFINE(IDirectInputDeviceA,IUnknown)
857 #undef ICOM_INTERFACE
859 /*** IUnknown methods ***/
860 #define IDirectInputDevice_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
861 #define IDirectInputDevice_AddRef(p) ICOM_CALL (AddRef,p)
862 #define IDirectInputDevice_Release(p) ICOM_CALL (Release,p)
863 /*** IDirectInputDevice methods ***/
864 #define IDirectInputDevice_GetCapabilities(p,a) ICOM_CALL1(GetCapabilities,p,a)
865 #define IDirectInputDevice_EnumObjects(p,a,b,c) ICOM_CALL3(EnumObjects,p,a,b,c)
866 #define IDirectInputDevice_GetProperty(p,a,b) ICOM_CALL2(GetProperty,p,a,b)
867 #define IDirectInputDevice_SetProperty(p,a,b) ICOM_CALL2(SetProperty,p,a,b)
868 #define IDirectInputDevice_Acquire(p) ICOM_CALL (Acquire,p)
869 #define IDirectInputDevice_Unacquire(p) ICOM_CALL (Unacquire,p)
870 #define IDirectInputDevice_GetDeviceState(p,a,b) ICOM_CALL2(GetDeviceState,p,a,b)
871 #define IDirectInputDevice_GetDeviceData(p,a,b,c,d) ICOM_CALL4(GetDeviceData,p,a,b,c,d)
872 #define IDirectInputDevice_SetDataFormat(p,a) ICOM_CALL1(SetDataFormat,p,a)
873 #define IDirectInputDevice_SetEventNotification(p,a) ICOM_CALL1(SetEventNotification,p,a)
874 #define IDirectInputDevice_SetCooperativeLevel(p,a,b) ICOM_CALL2(SetCooperativeLevel,p,a,b)
875 #define IDirectInputDevice_GetObjectInfo(p,a,b,c) ICOM_CALL3(GetObjectInfo,p,a,b,c)
876 #define IDirectInputDevice_GetDeviceInfo(p,a) ICOM_CALL1(GetDeviceInfo,p,a)
877 #define IDirectInputDevice_RunControlPanel(p,a,b) ICOM_CALL2(RunControlPanel,p,a,b)
878 #define IDirectInputDevice_Initialize(p,a,b,c) ICOM_CALL3(Initialize,p,a,b,c)
881 /*****************************************************************************
882 * IDirectInputDevice2A interface
884 #define ICOM_INTERFACE IDirectInputDevice2A
885 #define IDirectInputDevice2A_METHODS \
886 ICOM_METHOD4(HRESULT,CreateEffect, REFGUID,rguid, LPCDIEFFECT,lpeff, LPDIRECTINPUTEFFECT*,ppdeff, LPUNKNOWN,punkOuter) \
887 ICOM_METHOD3(HRESULT,EnumEffects, LPDIENUMEFFECTSCALLBACKA,lpCallback, LPVOID,pvRef, DWORD,dwEffType) \
888 ICOM_METHOD2(HRESULT,GetEffectInfo, LPDIEFFECTINFOA,pdei, REFGUID,rguid) \
889 ICOM_METHOD1(HRESULT,GetForceFeedbackState, LPDWORD,pdwOut) \
890 ICOM_METHOD1(HRESULT,SendForceFeedbackCommand, DWORD,dwFlags) \
891 ICOM_METHOD3(HRESULT,EnumCreatedEffectObjects, LPDIENUMCREATEDEFFECTOBJECTSCALLBACK,lpCallback, LPVOID,pvRef, DWORD,fl) \
892 ICOM_METHOD1(HRESULT,Escape, LPDIEFFESCAPE,pesc) \
893 ICOM_METHOD (HRESULT,Poll) \
894 ICOM_METHOD4(HRESULT,SendDeviceData, DWORD,cbObjectData, LPDIDEVICEOBJECTDATA,rgdod, LPDWORD,pdwInOut, DWORD,fl)
895 #define IDirectInputDevice2A_IMETHODS \
896 IDirectInputDeviceA_IMETHODS \
897 IDirectInputDevice2A_METHODS
898 ICOM_DEFINE(IDirectInputDevice2A,IDirectInputDeviceA)
899 #undef ICOM_INTERFACE
901 /*** IUnknown methods ***/
902 #define IDirectInputDevice2_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
903 #define IDirectInputDevice2_AddRef(p) ICOM_CALL (AddRef,p)
904 #define IDirectInputDevice2_Release(p) ICOM_CALL (Release,p)
905 /*** IDirectInputDevice methods ***/
906 #define IDirectInputDevice2_GetCapabilities(p,a) ICOM_CALL1(GetCapabilities,p,a)
907 #define IDirectInputDevice2_EnumObjects(p,a,b,c) ICOM_CALL3(EnumObjects,p,a,b,c)
908 #define IDirectInputDevice2_GetProperty(p,a,b) ICOM_CALL2(GetProperty,p,a,b)
909 #define IDirectInputDevice2_SetProperty(p,a,b) ICOM_CALL2(SetProperty,p,a,b)
910 #define IDirectInputDevice2_Acquire(p) ICOM_CALL (Acquire,p)
911 #define IDirectInputDevice2_Unacquire(p) ICOM_CALL (Unacquire,p)
912 #define IDirectInputDevice2_GetDeviceState(p,a,b) ICOM_CALL2(GetDeviceState,p,a,b)
913 #define IDirectInputDevice2_GetDeviceData(p,a,b,c,d) ICOM_CALL4(GetDeviceData,p,a,b,c,d)
914 #define IDirectInputDevice2_SetDataFormat(p,a) ICOM_CALL1(SetDataFormat,p,a)
915 #define IDirectInputDevice2_SetEventNotification(p,a) ICOM_CALL1(SetEventNotification,p,a)
916 #define IDirectInputDevice2_SetCooperativeLevel(p,a,b) ICOM_CALL2(SetCooperativeLevel,p,a,b)
917 #define IDirectInputDevice2_GetObjectInfo(p,a,b,c) ICOM_CALL3(GetObjectInfo,p,a,b,c)
918 #define IDirectInputDevice2_GetDeviceInfo(p,a) ICOM_CALL1(GetDeviceInfo,p,a)
919 #define IDirectInputDevice2_RunControlPanel(p,a,b) ICOM_CALL2(RunControlPanel,p,a,b)
920 #define IDirectInputDevice2_Initialize(p,a,b,c) ICOM_CALL3(Initialize,p,a,b,c)
921 /*** IDirectInputDevice2 methods ***/
922 #define IDirectInputDevice2_CreateEffect(p,a,b,c,d) ICOM_CALL4(CreateEffect,p,a,b,c,d)
923 #define IDirectInputDevice2_EnumEffects(p,a,b,c) ICOM_CALL3(EnumEffects,p,a,b,c)
924 #define IDirectInputDevice2_GetEffectInfo(p,a,b) ICOM_CALL2(GetEffectInfo,p,a,b)
925 #define IDirectInputDevice2_GetForceFeedbackState(p,a) ICOM_CALL1(GetForceFeedbackState,p,a)
926 #define IDirectInputDevice2_SendForceFeedbackCommand(p,a) ICOM_CALL1(SendForceFeedbackCommand,p,a)
927 #define IDirectInputDevice2_EnumCreatedEffectObjects(p,a,b,c) ICOM_CALL3(EnumCreatedEffectObjects,p,a,b,c)
928 #define IDirectInputDevice2_Escape(p,a) ICOM_CALL1(Escape,p,a)
929 #define IDirectInputDevice2_Poll(p) ICOM_CALL (Poll,p)
930 #define IDirectInputDevice2_SendDeviceData(p,a,b,c,d) ICOM_CALL4(SendDeviceData,p,a,b,c,d)
932 /*****************************************************************************
933 * IDirectInputDevice7A interface
935 #define ICOM_INTERFACE IDirectInputDevice7A
936 #define IDirectInputDevice7A_METHODS \
937 ICOM_METHOD4(HRESULT,EnumEffectsInFile,LPCSTR,lpszFileName,LPDIENUMEFFECTSINFILECALLBACK,pec,LPVOID,pvRef,DWORD,dwFlags) \
938 ICOM_METHOD4(HRESULT,WriteEffectToFile,LPCSTR,lpszFileName,DWORD,dwEntries,LPDIFILEEFFECT,rgDiFileEft,DWORD,dwFlags)
939 #define IDirectInputDevice7A_IMETHODS \
940 IDirectInputDeviceA_IMETHODS \
941 IDirectInputDevice2A_METHODS \
942 IDirectInputDevice7A_METHODS
943 ICOM_DEFINE(IDirectInputDevice7A,IDirectInputDevice2A)
944 #undef ICOM_INTERFACE
946 /*** IUnknown methods ***/
947 #define IDirectInputDevice7_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
948 #define IDirectInputDevice7_AddRef(p) ICOM_CALL (AddRef,p)
949 #define IDirectInputDevice7_Release(p) ICOM_CALL (Release,p)
950 /*** IDirectInputDevice methods ***/
951 #define IDirectInputDevice7_GetCapabilities(p,a) ICOM_CALL1(GetCapabilities,p,a)
952 #define IDirectInputDevice7_EnumObjects(p,a,b,c) ICOM_CALL3(EnumObjects,p,a,b,c)
953 #define IDirectInputDevice7_GetProperty(p,a,b) ICOM_CALL2(GetProperty,p,a,b)
954 #define IDirectInputDevice7_SetProperty(p,a,b) ICOM_CALL2(SetProperty,p,a,b)
955 #define IDirectInputDevice7_Acquire(p) ICOM_CALL (Acquire,p)
956 #define IDirectInputDevice7_Unacquire(p) ICOM_CALL (Unacquire,p)
957 #define IDirectInputDevice7_GetDeviceState(p,a,b) ICOM_CALL2(GetDeviceState,p,a,b)
958 #define IDirectInputDevice7_GetDeviceData(p,a,b,c,d) ICOM_CALL4(GetDeviceData,p,a,b,c,d)
959 #define IDirectInputDevice7_SetDataFormat(p,a) ICOM_CALL1(SetDataFormat,p,a)
960 #define IDirectInputDevice7_SetEventNotification(p,a) ICOM_CALL1(SetEventNotification,p,a)
961 #define IDirectInputDevice7_SetCooperativeLevel(p,a,b) ICOM_CALL2(SetCooperativeLevel,p,a,b)
962 #define IDirectInputDevice7_GetObjectInfo(p,a,b,c) ICOM_CALL3(GetObjectInfo,p,a,b,c)
963 #define IDirectInputDevice7_GetDeviceInfo(p,a) ICOM_CALL1(GetDeviceInfo,p,a)
964 #define IDirectInputDevice7_RunControlPanel(p,a,b) ICOM_CALL2(RunControlPanel,p,a,b)
965 #define IDirectInputDevice7_Initialize(p,a,b,c) ICOM_CALL3(Initialize,p,a,b,c)
966 /*** IDirectInputDevice2 methods ***/
967 #define IDirectInputDevice7_CreateEffect(p,a,b,c,d) ICOM_CALL4(CreateEffect,p,a,b,c,d)
968 #define IDirectInputDevice7_EnumEffects(p,a,b,c) ICOM_CALL3(EnumEffects,p,a,b,c)
969 #define IDirectInputDevice7_GetEffectInfo(p,a,b) ICOM_CALL2(GetEffectInfo,p,a,b)
970 #define IDirectInputDevice7_GetForceFeedbackState(p,a) ICOM_CALL1(GetForceFeedbackState,p,a)
971 #define IDirectInputDevice7_SendForceFeedbackCommand(p,a) ICOM_CALL1(SendForceFeedbackCommand,p,a)
972 #define IDirectInputDevice7_EnumCreatedEffectObjects(p,a,b,c) ICOM_CALL3(EnumCreatedEffectObjects,p,a,b,c)
973 #define IDirectInputDevice7_Escape(p,a) ICOM_CALL1(Escape,p,a)
974 #define IDirectInputDevice7_Poll(p) ICOM_CALL (Poll,p)
975 #define IDirectInputDevice7_SendDeviceData(p,a,b,c,d) ICOM_CALL4(SendDeviceData,p,a,b,c,d)
976 /*** IDirectInputDevice7 methods ***/
977 #define IDirectInputDevice7_EnumEffectsInFile(p,a,b,c,d) ICOM_CALL4(EnumEffectsInFile,p,a,b,c,d)
978 #define IDirectInputDevice7_WriteEffectToFile(p,a,b,c,d) ICOM_CALL4(WriteEffectToFile,p,a,b,c,d)
980 /* "Standard" Mouse report... */
981 typedef struct DIMOUSESTATE {
982 LONG lX;
983 LONG lY;
984 LONG lZ;
985 BYTE rgbButtons[4];
986 } DIMOUSESTATE;
988 /* "Standard" Mouse report for DInput 7... */
989 typedef struct DIMOUSESTATE2 {
990 LONG lX;
991 LONG lY;
992 LONG lZ;
993 BYTE rgbButtons[8];
994 } DIMOUSESTATE2;
996 #define DIMOFS_X FIELD_OFFSET(DIMOUSESTATE, lX)
997 #define DIMOFS_Y FIELD_OFFSET(DIMOUSESTATE, lY)
998 #define DIMOFS_Z FIELD_OFFSET(DIMOUSESTATE, lZ)
999 #define DIMOFS_BUTTON0 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 0)
1000 #define DIMOFS_BUTTON1 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 1)
1001 #define DIMOFS_BUTTON2 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 2)
1002 #define DIMOFS_BUTTON3 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 3)
1004 #ifdef __cplusplus
1005 extern "C" {
1006 #endif
1007 extern const DIDATAFORMAT c_dfDIMouse;
1008 extern const DIDATAFORMAT c_dfDIMouse2; /* DX 7 */
1009 extern const DIDATAFORMAT c_dfDIKeyboard;
1010 extern const DIDATAFORMAT c_dfDIJoystick;
1011 extern const DIDATAFORMAT c_dfDIJoystick2;
1012 #ifdef __cplusplus
1014 #endif
1016 /*****************************************************************************
1017 * IDirectInputA interface
1019 #define ICOM_INTERFACE IDirectInputA
1020 #define IDirectInputA_METHODS \
1021 ICOM_METHOD3(HRESULT,CreateDevice, REFGUID,rguid, LPDIRECTINPUTDEVICEA*,lplpDirectInputDevice, LPUNKNOWN,pUnkOuter) \
1022 ICOM_METHOD4(HRESULT,EnumDevices, DWORD,dwDevType, LPDIENUMDEVICESCALLBACKA,lpCallback, LPVOID,pvRef, DWORD,dwFlags) \
1023 ICOM_METHOD1(HRESULT,GetDeviceStatus, REFGUID,rguidInstance) \
1024 ICOM_METHOD2(HRESULT,RunControlPanel, HWND,hwndOwner, DWORD,dwFlags) \
1025 ICOM_METHOD2(HRESULT,Initialize, HINSTANCE,hinst, DWORD,dwVersion)
1026 #define IDirectInputA_IMETHODS \
1027 IUnknown_IMETHODS \
1028 IDirectInputA_METHODS
1029 ICOM_DEFINE(IDirectInputA,IUnknown)
1030 #undef ICOM_INTERFACE
1032 /*** IUnknown methods ***/
1033 #define IDirectInputA_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
1034 #define IDirectInputA_AddRef(p) ICOM_CALL (AddRef,p)
1035 #define IDirectInputA_Release(p) ICOM_CALL (Release,p)
1036 /*** IDirectInputA methods ***/
1037 #define IDirectInputA_CreateDevice(p,a,b,c) ICOM_CALL3(CreateDevice,p,a,b,c)
1038 #define IDirectInputA_EnumDevices(p,a,b,c,d) ICOM_CALL4(EnumDevices,p,a,b,c,d)
1039 #define IDirectInputA_GetDeviceStatus(p,a) ICOM_CALL1(GetDeviceStatus,p,a)
1040 #define IDirectInputA_RunControlPanel(p,a,b) ICOM_CALL2(RunControlPanel,p,a,b)
1041 #define IDirectInputA_Initialize(p,a,b) ICOM_CALL2(Initialize,p,a,b)
1043 /*****************************************************************************
1044 * IDirectInput2A interface
1046 #define ICOM_INTERFACE IDirectInput2A
1047 #define IDirectInput2A_METHODS \
1048 ICOM_METHOD3(HRESULT,FindDevice, REFGUID,rguid, LPCSTR,pszName, LPGUID,pguidInstance)
1049 #define IDirectInput2A_IMETHODS \
1050 IDirectInputA_IMETHODS \
1051 IDirectInput2A_METHODS
1052 ICOM_DEFINE(IDirectInput2A,IDirectInputA)
1053 #undef ICOM_INTERFACE
1055 /*** IUnknown methods ***/
1056 #define IDirectInput2A_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
1057 #define IDirectInput2A_AddRef(p) ICOM_CALL (AddRef,p)
1058 #define IDirectInput2A_Release(p) ICOM_CALL (Release,p)
1059 /*** IDirectInputA methods ***/
1060 #define IDirectInput2A_CreateDevice(p,a,b,c) ICOM_CALL3(CreateDevice,p,a,b,c)
1061 #define IDirectInput2A_EnumDevices(p,a,b,c,d) ICOM_CALL4(EnumDevices,p,a,b,c,d)
1062 #define IDirectInput2A_GetDeviceStatus(p,a) ICOM_CALL1(GetDeviceStatus,p,a)
1063 #define IDirectInput2A_RunControlPanel(p,a,b) ICOM_CALL2(RunControlPanel,p,a,b)
1064 #define IDirectInput2A_Initialize(p,a,b) ICOM_CALL2(Initialize,p,a,b)
1065 /*** IDirectInput2A methods ***/
1066 #define IDirectInput2A_FindDevice(p,a,b,c) ICOM_CALL3(FindDevice,p,a,b,c)
1068 /*****************************************************************************
1069 * IDirectInput7A interface
1071 #define ICOM_INTERFACE IDirectInput7A
1072 #define IDirectInput7A_METHODS \
1073 ICOM_METHOD4(HRESULT,CreateDeviceEx, REFGUID,rguid, REFIID,riid, LPVOID*,pvOut, LPUNKNOWN,lpUnknownOuter)
1074 #define IDirectInput7A_IMETHODS \
1075 IDirectInput2A_IMETHODS \
1076 IDirectInput7A_METHODS
1077 ICOM_DEFINE(IDirectInput7A,IDirectInput2A)
1078 #undef ICOM_INTERFACE
1080 /*** IUnknown methods ***/
1081 #define IDirectInput7A_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
1082 #define IDirectInput7A_AddRef(p) ICOM_CALL (AddRef,p)
1083 #define IDirectInput7A_Release(p) ICOM_CALL (Release,p)
1084 /*** IDirectInputA methods ***/
1085 #define IDirectInput7A_CreateDevice(p,a,b,c) ICOM_CALL3(CreateDevice,p,a,b,c)
1086 #define IDirectInput7A_EnumDevices(p,a,b,c,d) ICOM_CALL4(EnumDevices,p,a,b,c,d)
1087 #define IDirectInput7A_GetDeviceStatus(p,a) ICOM_CALL1(GetDeviceStatus,p,a)
1088 #define IDirectInput7A_RunControlPanel(p,a,b) ICOM_CALL2(RunControlPanel,p,a,b)
1089 #define IDirectInput7A_Initialize(p,a,b) ICOM_CALL2(Initialize,p,a,b)
1090 /*** IDirectInput2A methods ***/
1091 #define IDirectInput7A_FindDevice(p,a,b,c) ICOM_CALL3(FindDevice,p,a,b,c)
1092 /*** IDirectInput7A methods ***/
1093 #define IDirectInput7A_CreateDeviceEx(p,a,b,c,d) ICOM_CALL4(CreateDeviceEx,p,a,b,c,d)
1095 /* Export functions */
1097 #ifdef __cplusplus
1098 extern "C" {
1099 #endif
1101 HRESULT WINAPI DirectInputCreateA(HINSTANCE,DWORD,LPDIRECTINPUTA *,LPUNKNOWN);
1102 HRESULT WINAPI DirectInputCreateW(HINSTANCE,DWORD,LPDIRECTINPUTA *,LPUNKNOWN);
1103 #define DirectInputCreate WINELIB_NAME_AW(DirectInputCreate)
1105 HRESULT WINAPI DirectInputCreateEx(HINSTANCE,DWORD,REFIID,LPVOID *,LPUNKNOWN);
1107 #ifdef __cplusplus
1109 #endif
1111 #endif /* __WINE_DINPUT_H */