浏览代码

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

Fixes Bugzilla #2822.
Ryan C. Gordon 10 年之前
父节点
当前提交
201868156e
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/joystick/darwin/SDL_sysjoystick.c

+ 1 - 1
src/joystick/darwin/SDL_sysjoystick.c

@@ -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. */