mirror of
https://github.com/glfw/glfw.git
synced 2025-10-04 05:36:35 +00:00
parent
f51cf81148
commit
87293db93b
@ -29,6 +29,7 @@
|
||||
|
||||
#include <unistd.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <mach/mach.h>
|
||||
#include <mach/mach_error.h>
|
||||
@ -287,11 +288,17 @@ static void matchCallback(void* context,
|
||||
|
||||
CFStringRef name = IOHIDDeviceGetProperty(deviceRef,
|
||||
CFSTR(kIOHIDProductKey));
|
||||
CFStringGetCString(name,
|
||||
joystick->name,
|
||||
sizeof(joystick->name),
|
||||
kCFStringEncodingUTF8);
|
||||
|
||||
if (name)
|
||||
{
|
||||
CFStringGetCString(name,
|
||||
joystick->name,
|
||||
sizeof(joystick->name),
|
||||
kCFStringEncodingUTF8);
|
||||
}
|
||||
else
|
||||
{
|
||||
strncpy(joystick->name, "Unknown", sizeof(joystick->name));
|
||||
}
|
||||
joystick->axisElements = CFArrayCreateMutable(NULL, 0, NULL);
|
||||
joystick->buttonElements = CFArrayCreateMutable(NULL, 0, NULL);
|
||||
joystick->hatElements = CFArrayCreateMutable(NULL, 0, NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user