diff --git a/stepmania/src/arch/InputHandler/InputHandler_Carbon.cpp b/stepmania/src/arch/InputHandler/InputHandler_Carbon.cpp index eccb564a66..645acf1738 100644 --- a/stepmania/src/arch/InputHandler/InputHandler_Carbon.cpp +++ b/stepmania/src/arch/InputHandler/InputHandler_Carbon.cpp @@ -182,6 +182,7 @@ void InputHandler_Carbon::AddDevices( int usagePage, int usage, InputDevice &id while( (device = IOIteratorNext(iter)) ) { HIDDevice *dev = MakeDevice( id ); + int num; if( !dev ) { @@ -189,14 +190,12 @@ void InputHandler_Carbon::AddDevices( int usagePage, int usage, InputDevice &id continue; } - if( !dev->Open(device) ) + if( !dev->Open(device) || (num = dev->AssignIDs(id)) == -1 ) { delete dev; IOObjectRelease( device ); continue; } - - int num = dev->AssignIDs( id ); io_iterator_t i; enum_add( id, num ); diff --git a/stepmania/src/archutils/Darwin/HIDDevice.h b/stepmania/src/archutils/Darwin/HIDDevice.h index 72038f67a3..7357c94b93 100644 --- a/stepmania/src/archutils/Darwin/HIDDevice.h +++ b/stepmania/src/archutils/Darwin/HIDDevice.h @@ -103,7 +103,8 @@ public: /* * Returns the number of IDs assigned starting from startID. This is not meaningful for devices like * keyboards that all share the same InputDevice id. If a particular device has multiple logical - * devices, then it must ensure that AssignIDs does not assign an ID outside of its range. + * devices, then it must ensure that AssignIDs does not assign an ID outside of its range. Return + * -1 to indicate that the device does not share the same InputDevice and none could be assigned. */ virtual int AssignIDs( InputDevice startID ) { return 0; }