mirror of
https://github.com/glfw/glfw.git
synced 2026-09-22 16:52:57 +00:00
Add support for joystick hot swapping on OS X.
This commit is contained in:
committed by
Camilla Berglund
parent
19a28e2c9f
commit
1a96c294ee
+12
-3
@@ -33,17 +33,17 @@
|
||||
#include <IOKit/hid/IOHIDKeys.h>
|
||||
|
||||
#define _GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE \
|
||||
_GLFWjoystickIOKit iokit_js[GLFW_JOYSTICK_LAST + 1]
|
||||
_GLFWjoystickIOKit iokit_js
|
||||
|
||||
|
||||
// IOKit-specific per-joystick data
|
||||
//
|
||||
typedef struct _GLFWjoystickIOKit
|
||||
typedef struct _GLFWjoydevice
|
||||
{
|
||||
int present;
|
||||
char name[256];
|
||||
|
||||
IOHIDDeviceInterface** interface;
|
||||
IOHIDDeviceRef deviceRef;
|
||||
|
||||
CFMutableArrayRef axisElements;
|
||||
CFMutableArrayRef buttonElements;
|
||||
@@ -51,7 +51,16 @@ typedef struct _GLFWjoystickIOKit
|
||||
|
||||
float* axes;
|
||||
unsigned char* buttons;
|
||||
} _GLFWjoydevice;
|
||||
|
||||
|
||||
// IOKit-specific joystick API data
|
||||
//
|
||||
typedef struct _GLFWjoystickIOKit
|
||||
{
|
||||
_GLFWjoydevice devices[GLFW_JOYSTICK_LAST + 1];
|
||||
|
||||
IOHIDManagerRef managerRef;
|
||||
} _GLFWjoystickIOKit;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user