Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixed force feedback detection of joystick devices
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Aug 11, 2008
1 parent 1c07910 commit 4b27377
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions src/joystick/darwin/SDL_sysjoystick.c
Expand Up @@ -647,20 +647,6 @@ SDL_SYS_JoystickInit(void)
if (!device)
continue;

/* We have to do some storage of the io_service_t for
* SDL_HapticOpenFromJoystick */
if (FFIsForceFeedback((io_service_t)device) == FF_OK) {
device->ffservice = ioHIDDeviceObject;
}
else {
device->ffservice = 0;
/* dump device object, it is no longer needed */
result = IOObjectRelease(ioHIDDeviceObject);
}
/* if (KERN_SUCCESS != result)
HIDReportErrorNum ("IOObjectRelease error with ioHIDDeviceObject.", result);
*/

/* Filter device list to non-keyboard/mouse stuff */
if ((device->usagePage != kHIDPage_GenericDesktop) ||
((device->usage != kHIDUsage_GD_Joystick &&
Expand All @@ -673,6 +659,15 @@ SDL_SYS_JoystickInit(void)
continue;
}

/* We have to do some storage of the io_service_t for
* SDL_HapticOpenFromJoystick */
if (FFIsForceFeedback(ioHIDDeviceObject) == FF_OK) {
device->ffservice = ioHIDDeviceObject;
}
else {
device->ffservice = 0;
}

/* Add device to the end of the list */
if (lastDevice)
lastDevice->pNext = device;
Expand Down

0 comments on commit 4b27377

Please sign in to comment.