2 SDL - Simple DirectMedia Layer
3 Copyright (C) 1997-2010 Sam Lantinga
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #include "SDL_config.h"
24 #ifndef SDL_JOYSTICK_IOKIT_H
27 #if MAC_OS_X_VERSION_MIN_REQUIRED == 1030
28 #include "10.3.9-FIX/IOHIDLib.h"
30 #include <IOKit/hid/IOHIDLib.h>
32 #include <IOKit/hid/IOHIDKeys.h>
37 IOHIDElementCookie cookie; /* unique value which identifies element, will NOT change */
38 long usagePage, usage; /* HID usage */
39 long min; /* reported min value possible */
40 long max; /* reported max value possible */
42 /* TODO: maybe should handle the following stuff somehow? */
44 long scaledMin; /* reported scaled min value possible */
45 long scaledMax; /* reported scaled max value possible */
46 long size; /* size in bits of data return from element */
47 Boolean relative; /* are reports relative to last report (deltas) */
48 Boolean wrapping; /* does element wrap around (one value higher than max is min) */
49 Boolean nonLinear; /* are the values reported non-linear relative to element movement */
50 Boolean preferredState; /* does element have a preferred state (such as a button) */
51 Boolean nullState; /* does element have null state */
54 /* runtime variables used for auto-calibration */
55 long minReport; /* min returned value */
56 long maxReport; /* max returned value */
58 struct recElement *pNext; /* next element in list */
60 typedef struct recElement recElement;
62 struct joystick_hwdata
64 io_service_t ffservice; /* Interface for force feedback, 0 = no ff */
65 IOHIDDeviceInterface **interface; /* interface to device, NULL = no interface */
67 char product[256]; /* name of product */
68 long usage; /* usage page from IOUSBHID Parser.h which defines general usage */
69 long usagePage; /* usage within above page from IOUSBHID Parser.h which defines specific usage */
71 long axes; /* number of axis (calculated, not reported by device) */
72 long buttons; /* number of buttons (calculated, not reported by device) */
73 long hats; /* number of hat switches (calculated, not reported by device) */
74 long elements; /* number of total elements (shouldbe total of above) (calculated, not reported by device) */
76 recElement *firstAxis;
77 recElement *firstButton;
83 struct joystick_hwdata *pNext; /* next device */
85 typedef struct joystick_hwdata recDevice;
88 #endif /* SDL_JOYSTICK_IOKIT_H */