Mac OS X: Better way to stop duplicate joystick reports (thanks, Kyungdahm!).

Fixes Bugzilla #2822.
This commit is contained in:
Ryan C. Gordon 2015-02-19 23:52:10 -05:00
parent 33b9d9ad7f
commit 201868156e
1 changed files with 1 additions and 1 deletions

View File

@ -446,9 +446,9 @@ ConfigHIDManager(CFArrayRef matchingArray)
return SDL_FALSE; return SDL_FALSE;
} }
IOHIDManagerSetDeviceMatchingMultiple(hidman, matchingArray);
IOHIDManagerRegisterDeviceMatchingCallback(hidman, JoystickDeviceWasAddedCallback, NULL); IOHIDManagerRegisterDeviceMatchingCallback(hidman, JoystickDeviceWasAddedCallback, NULL);
IOHIDManagerScheduleWithRunLoop(hidman, runloop, SDL_JOYSTICK_RUNLOOP_MODE); IOHIDManagerScheduleWithRunLoop(hidman, runloop, SDL_JOYSTICK_RUNLOOP_MODE);
IOHIDManagerSetDeviceMatchingMultiple(hidman, matchingArray);
while (CFRunLoopRunInMode(SDL_JOYSTICK_RUNLOOP_MODE,0,TRUE) == kCFRunLoopRunHandledSource) { while (CFRunLoopRunInMode(SDL_JOYSTICK_RUNLOOP_MODE,0,TRUE) == kCFRunLoopRunHandledSource) {
/* no-op. Callback fires once per existing device. */ /* no-op. Callback fires once per existing device. */