File tree Expand file tree Collapse file tree 1 file changed +16
-12
lines changed Expand file tree Collapse file tree 1 file changed +16
-12
lines changed Original file line number Diff line number Diff line change @@ -298,16 +298,8 @@ static void osx_joy_generate_configure_event(void)
298
298
_al_generate_joystick_event (&event);
299
299
}
300
300
301
- static void device_add_callback (
302
- void *context,
303
- IOReturn result,
304
- void *sender,
305
- IOHIDDeviceRef ref
306
- ) {
307
- (void )context;
308
- (void )result;
309
- (void )sender;
310
-
301
+ static void add_joystick_device (IOHIDDeviceRef ref, bool emit_reconfigure_event)
302
+ {
311
303
al_lock_mutex (add_mutex);
312
304
313
305
ALLEGRO_JOYSTICK_OSX *joy = find_joystick (ref);
@@ -329,15 +321,27 @@ static void device_add_callback(
329
321
330
322
CFRelease (elements);
331
323
332
-
333
324
al_unlock_mutex (add_mutex);
334
325
335
- osx_joy_generate_configure_event ();
326
+ if (emit_reconfigure_event) osx_joy_generate_configure_event ();
336
327
337
328
ALLEGRO_INFO (" Found joystick (%d buttons, %d sticks)\n " ,
338
329
joy->parent .info .num_buttons , joy->parent .info .num_sticks );
339
330
}
340
331
332
+ static void device_add_callback (
333
+ void *context,
334
+ IOReturn result,
335
+ void *sender,
336
+ IOHIDDeviceRef ref
337
+ ) {
338
+ (void )context;
339
+ (void )result;
340
+ (void )sender;
341
+
342
+ add_joystick_device (ref, true );
343
+ }
344
+
341
345
static void device_remove_callback (
342
346
void *context,
343
347
IOReturn result,
You can’t perform that action at this time.
0 commit comments