SDL_sysjoystick_c.h
Go to the documentation of this file.
/*
Simple DirectMedia Layer
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#include "../../SDL_internal.h"
#ifndef SDL_JOYSTICK_IOKIT_H
#define SDL_JOYSTICK_IOKIT_H
#include <IOKit/hid/IOHIDLib.h>
struct recElement
{
IOHIDElementRef elementRef;
IOHIDElementCookie cookie;
uint32_t usagePage, usage; /* HID usage */
SInt32 min; /* reported min value possible */
SInt32 max; /* reported max value possible */
/* runtime variables used for auto-calibration */
SInt32 minReport; /* min returned value */
SInt32 maxReport; /* max returned value */
struct recElement *pNext; /* next element in list */
};
typedef struct recElement recElement;
struct joystick_hwdata
{
IOHIDDeviceRef deviceRef; /* HIDManager device handle */
io_service_t ffservice; /* Interface for force feedback, 0 = no ff */
char product[256]; /* name of product */
uint32_t usage; /* usage page from IOUSBHID Parser.h which defines general usage */
uint32_t usagePage; /* usage within above page from IOUSBHID Parser.h which defines specific usage */
int axes; /* number of axis (calculated, not reported by device) */
int buttons; /* number of buttons (calculated, not reported by device) */
int hats; /* number of hat switches (calculated, not reported by device) */
int elements; /* number of total elements (should be total of above) (calculated, not reported by device) */
recElement *firstAxis;
recElement *firstButton;
recElement *firstHat;
SDL_bool removed;
int instance_id;
SDL_JoystickGUID guid;
struct joystick_hwdata *pNext; /* next device */
};
typedef struct joystick_hwdata recDevice;
#endif /* SDL_JOYSTICK_IOKIT_H */
/* 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