From 02786346b84323bc81f9c0467a2cc20aef7d32b9 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Thu, 9 Feb 2006 01:53:24 +0000 Subject: [PATCH] use gamepads --- .../src/arch/InputHandler/InputHandler_Carbon.cpp | 2 +- stepmania/src/archutils/Darwin/JoystickDevice.cpp | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/stepmania/src/arch/InputHandler/InputHandler_Carbon.cpp b/stepmania/src/arch/InputHandler/InputHandler_Carbon.cpp index e34c424834..45ba61c04f 100644 --- a/stepmania/src/arch/InputHandler/InputHandler_Carbon.cpp +++ b/stepmania/src/arch/InputHandler/InputHandler_Carbon.cpp @@ -194,7 +194,7 @@ InputHandler_Carbon::InputHandler_Carbon() : m_Sem( "Input thread started" ), m_ } // 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, InputHandler_Carbon::DeviceAdded, this, &iter ); diff --git a/stepmania/src/archutils/Darwin/JoystickDevice.cpp b/stepmania/src/archutils/Darwin/JoystickDevice.cpp index 131de568f2..d9fd30e7b5 100644 --- a/stepmania/src/archutils/Darwin/JoystickDevice.cpp +++ b/stepmania/src/archutils/Darwin/JoystickDevice.cpp @@ -19,8 +19,16 @@ Joystick::Joystick() : id( DEVICE_NONE ), bool JoystickDevice::AddLogicalDevice( int usagePage, int usage ) { - if( usagePage != kHIDPage_GenericDesktop || usage != kHIDUsage_GD_Joystick ) + if( usagePage != kHIDPage_GenericDesktop ) return false; + switch( usage ) + { + case kHIDUsage_GD_Joystick: + case kHIDUsage_GD_GamePad: + break; + default: + return false; + } m_vSticks.push_back( Joystick() ); return true; }