From b69ccaf0f6ac7326b61bdfa4b2dbf3483da850d1 Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Wed, 23 Feb 2011 19:50:00 -0600 Subject: [PATCH] easing scope was a no go --- src/archutils/Darwin/MouseDevice.cpp | 53 +++++++++++++--------------- 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/src/archutils/Darwin/MouseDevice.cpp b/src/archutils/Darwin/MouseDevice.cpp index 7e83921c57..6734b2619a 100644 --- a/src/archutils/Darwin/MouseDevice.cpp +++ b/src/archutils/Darwin/MouseDevice.cpp @@ -36,38 +36,35 @@ void MouseDevice::AddElement( int usagePage, int usage, IOHIDElementCookie cooki return; Mouse& m = m_Mouse; - + int iMin = 0; + int iMax = 0; switch( usagePage ) { case kHIDPage_GenericDesktop: - { // ease scope - int iMin = 0; - IntValue( CFDictionaryGetValue(properties, CFSTR(kIOHIDElementMinKey)), iMin ); - int iMax = 0; - IntValue( CFDictionaryGetValue(properties, CFSTR(kIOHIDElementMaxKey)), iMax ); + IntValue( CFDictionaryGetValue(properties, CFSTR(kIOHIDElementMinKey)), iMin ); + IntValue( CFDictionaryGetValue(properties, CFSTR(kIOHIDElementMaxKey)), iMax ); - // based on usage - switch( usage ) - { - case kHIDUsage_GD_X: - m.x_axis = cookie; - m.x_min = iMin; - m.x_max = iMax; - break; - case kHIDUsage_GD_Y: - m.y_axis = cookie; - m.y_min = iMin; - m.y_max = iMax; - break; - case kHIDUsage_GD_Z: - m.z_axis = cookie; - m.z_min = iMin; - m.z_max = iMax; - break; - default: - //LOG->Warn( "Unknown usagePage usage pair: (kHIDPage_GenericDesktop, %d).", usage ); - break; - } + // based on usage + switch( usage ) + { + case kHIDUsage_GD_X: + m.x_axis = cookie; + m.x_min = iMin; + m.x_max = iMax; + break; + case kHIDUsage_GD_Y: + m.y_axis = cookie; + m.y_min = iMin; + m.y_max = iMax; + break; + case kHIDUsage_GD_Z: + m.z_axis = cookie; + m.z_min = iMin; + m.z_max = iMax; + break; + default: + //LOG->Warn( "Unknown usagePage usage pair: (kHIDPage_GenericDesktop, %d).", usage ); + break; } break; case kHIDPage_Button: