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
44
struct
joystick_hwdata
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
58
recElement
*
firstAxis
;
59
recElement
*
firstButton
;
60
recElement
*
firstHat
;
61
62
SDL_bool
removed
;
63
64
int
instance_id
;
65
SDL_JoystickGUID
guid
;
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: */
joystick_hwdata::buttons
int buttons
Definition:
SDL_sysjoystick_c.h:54
joystick_hwdata::guid
SDL_JoystickGUID guid
Definition:
SDL_sysjoystick_c.h:65
recElement::minReport
SInt32 minReport
Definition:
SDL_sysjoystick_c.h:37
recElement::min
SInt32 min
Definition:
SDL_sysjoystick_c.h:33
joystick_hwdata::removed
SDL_bool removed
Definition:
SDL_sysjoystick_c.h:62
joystick_hwdata::firstHat
recElement * firstHat
Definition:
SDL_sysjoystick_c.h:60
recElement::pNext
struct recElement * pNext
Definition:
SDL_sysjoystick_c.h:40
recElement::cookie
IOHIDElementCookie cookie
Definition:
SDL_sysjoystick_c.h:31
joystick_hwdata
Definition:
SDL_sysjoystick_c.h:44
recElement::usagePage
uint32_t usagePage
Definition:
SDL_sysjoystick_c.h:32
joystick_hwdata::axes
int axes
Definition:
SDL_sysjoystick_c.h:53
joystick_hwdata::instance_id
int instance_id
Definition:
SDL_sysjoystick_c.h:64
recElement::usage
uint32_t usage
Definition:
SDL_sysjoystick_c.h:32
joystick_hwdata::elements
int elements
Definition:
SDL_sysjoystick_c.h:56
recElement::elementRef
IOHIDElementRef elementRef
Definition:
SDL_sysjoystick_c.h:30
joystick_hwdata::hats
int hats
Definition:
SDL_sysjoystick_c.h:55
joystick_hwdata::firstAxis
recElement * firstAxis
Definition:
SDL_sysjoystick_c.h:58
joystick_hwdata::deviceRef
IOHIDDeviceRef deviceRef
Definition:
SDL_sysjoystick_c.h:46
recElement::maxReport
SInt32 maxReport
Definition:
SDL_sysjoystick_c.h:38
SDL_bool
SDL_bool
Definition:
SDL_stdinc.h:139
uint32_t
unsigned int uint32_t
Definition:
SDL_config_windows.h:63
joystick_hwdata::usagePage
uint32_t usagePage
Definition:
SDL_sysjoystick_c.h:51
SDL_JoystickGUID
Definition:
SDL_joystick.h:70
recElement
Definition:
SDL_sysjoystick_c.h:28
joystick_hwdata::usage
uint32_t usage
Definition:
SDL_sysjoystick_c.h:50
recElement::max
SInt32 max
Definition:
SDL_sysjoystick_c.h:34
joystick_hwdata::ffservice
io_service_t ffservice
Definition:
SDL_sysjoystick_c.h:47
joystick_hwdata::pNext
struct joystick_hwdata * pNext
Definition:
SDL_sysjoystick_c.h:67
joystick_hwdata::firstButton
recElement * firstButton
Definition:
SDL_sysjoystick_c.h:59
src
joystick
darwin
SDL_sysjoystick_c.h
Generated by
1.8.13