SDL  2.0
SDL_sysjoystick_c.h
Go to the documentation of this file.
1 /*
2  Simple DirectMedia Layer
3  Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
4 
5  This software is provided 'as-is', without any express or implied
6  warranty. In no event will the authors be held liable for any damages
7  arising from the use of this software.
8 
9  Permission is granted to anyone to use this software for any purpose,
10  including commercial applications, and to alter it and redistribute it
11  freely, subject to the following restrictions:
12 
13  1. The origin of this software must not be misrepresented; you must not
14  claim that you wrote the original software. If you use this software
15  in a product, an acknowledgment in the product documentation would be
16  appreciated but is not required.
17  2. Altered source versions must be plainly marked as such, and must not be
18  misrepresented as being the original software.
19  3. This notice may not be removed or altered from any source distribution.
20 */
21 #include "../../SDL_internal.h"
22 
23 #ifndef SDL_JOYSTICK_IOKIT_H
24 #define SDL_JOYSTICK_IOKIT_H
25 
26 #include <IOKit/hid/IOHIDLib.h>
27 
28 struct recElement
29 {
30  IOHIDElementRef elementRef;
31  IOHIDElementCookie cookie;
32  uint32_t usagePage, usage; /* HID usage */
33  SInt32 min; /* reported min value possible */
34  SInt32 max; /* reported max value possible */
35 
36  /* runtime variables used for auto-calibration */
37  SInt32 minReport; /* min returned value */
38  SInt32 maxReport; /* max returned value */
39 
40  struct recElement *pNext; /* next element in list */
41 };
42 typedef struct recElement recElement;
43 
45 {
46  IOHIDDeviceRef deviceRef; /* HIDManager device handle */
47  io_service_t ffservice; /* Interface for force feedback, 0 = no ff */
48 
49  char product[256]; /* name of product */
50  uint32_t usage; /* usage page from IOUSBHID Parser.h which defines general usage */
51  uint32_t usagePage; /* usage within above page from IOUSBHID Parser.h which defines specific usage */
52 
53  int axes; /* number of axis (calculated, not reported by device) */
54  int buttons; /* number of buttons (calculated, not reported by device) */
55  int hats; /* number of hat switches (calculated, not reported by device) */
56  int elements; /* number of total elements (should be total of above) (calculated, not reported by device) */
57 
61 
63 
66 
67  struct joystick_hwdata *pNext; /* next device */
68 };
69 typedef struct joystick_hwdata recDevice;
70 
71 #endif /* SDL_JOYSTICK_IOKIT_H */
72 
73 /* vi: set ts=4 sw=4 expandtab: */
SDL_JoystickGUID guid
recElement * firstHat
struct recElement * pNext
IOHIDElementCookie cookie
uint32_t usagePage
uint32_t usage
IOHIDElementRef elementRef
recElement * firstAxis
IOHIDDeviceRef deviceRef
SDL_bool
Definition: SDL_stdinc.h:139
unsigned int uint32_t
io_service_t ffservice
struct joystick_hwdata * pNext
recElement * firstButton