use gamepads
This commit is contained in:
@@ -194,7 +194,7 @@ InputHandler_Carbon::InputHandler_Carbon() : m_Sem( "Input thread started" ), m_
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Find the joysticks.
|
// Find the joysticks.
|
||||||
dict = GetMatchingDictionary( kHIDPage_GenericDesktop, kHIDUsage_GD_Joystick );
|
dict = GetMatchingDictionary( kHIDPage_GenericDesktop, kHIDUsage_GD_Joystick|kHIDUsage_GD_GamePad );
|
||||||
ret = IOServiceAddMatchingNotification( m_NotifyPort, kIOFirstMatchNotification, dict,
|
ret = IOServiceAddMatchingNotification( m_NotifyPort, kIOFirstMatchNotification, dict,
|
||||||
InputHandler_Carbon::DeviceAdded, this, &iter );
|
InputHandler_Carbon::DeviceAdded, this, &iter );
|
||||||
|
|
||||||
|
|||||||
@@ -19,8 +19,16 @@ Joystick::Joystick() : id( DEVICE_NONE ),
|
|||||||
|
|
||||||
bool JoystickDevice::AddLogicalDevice( int usagePage, int usage )
|
bool JoystickDevice::AddLogicalDevice( int usagePage, int usage )
|
||||||
{
|
{
|
||||||
if( usagePage != kHIDPage_GenericDesktop || usage != kHIDUsage_GD_Joystick )
|
if( usagePage != kHIDPage_GenericDesktop )
|
||||||
return false;
|
return false;
|
||||||
|
switch( usage )
|
||||||
|
{
|
||||||
|
case kHIDUsage_GD_Joystick:
|
||||||
|
case kHIDUsage_GD_GamePad:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
m_vSticks.push_back( Joystick() );
|
m_vSticks.push_back( Joystick() );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user