From bb1f0be90c69a13e1a551190e804af5c48a38d9a Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Mon, 27 Feb 2006 00:45:22 +0000 Subject: [PATCH] If the joystick is a Para controller, attempt to power it on using SetReport(). [Not tested.] --- stepmania/src/archutils/Darwin/JoystickDevice.cpp | 12 ++++++++++++ stepmania/src/archutils/Darwin/JoystickDevice.h | 1 + 2 files changed, 13 insertions(+) diff --git a/stepmania/src/archutils/Darwin/JoystickDevice.cpp b/stepmania/src/archutils/Darwin/JoystickDevice.cpp index 279c923680..1812d629c4 100644 --- a/stepmania/src/archutils/Darwin/JoystickDevice.cpp +++ b/stepmania/src/archutils/Darwin/JoystickDevice.cpp @@ -115,6 +115,18 @@ void JoystickDevice::Open() AddElementToQueue( j->first ); } } +bool JoystickDevice::SupportsVidPid( int vid, int pid ) +{ + if( vid != 0x0507 || pid != 0x0011 ) + return true; + // It's a Para controller so try to power it on. + uint8_t powerOn = 1; + IOReturn ret = SetReport( kIOHIDReportTypeFeature, 0, &powerOn, 1, 10 ); + + if( ret ) + LOG->Warn( "Failed to power on the Para controller: %#08x", ret ); + return true; +} void JoystickDevice::GetButtonPresses( vector >& vPresses, int cookie, int value, const RageTimer& now ) const diff --git a/stepmania/src/archutils/Darwin/JoystickDevice.h b/stepmania/src/archutils/Darwin/JoystickDevice.h index bcea47d650..079c82adbd 100644 --- a/stepmania/src/archutils/Darwin/JoystickDevice.h +++ b/stepmania/src/archutils/Darwin/JoystickDevice.h @@ -25,6 +25,7 @@ protected: bool AddLogicalDevice( int usagePage, int usage ); void AddElement( int usagePage, int usage, int cookie, const CFDictionaryRef properties ); void Open(); + bool SupportsVidPid( int vid, int pid ); public: void GetButtonPresses( vector >& vPresses, int cookie,