summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Woyak <jordan.woyak@gmail.com>2013-02-05 13:51:08 -0600
committerJordan Woyak <jordan.woyak@gmail.com>2013-02-05 13:51:08 -0600
commitf506783c37b2bd7b50bf86015a030d7e0a74ff29 (patch)
treeb45aac5e76d6e1a25be17ae6c90ade531f13f17c
parent937d9e900717db5e5497eb4c15fda122e4502cdf (diff)
Number "unknown" axes in OSX rather than call them all "unk".
-rw-r--r--Source/Core/InputCommon/Src/ControllerInterface/OSX/OSXJoystick.mm11
1 files changed, 10 insertions, 1 deletions
diff --git a/Source/Core/InputCommon/Src/ControllerInterface/OSX/OSXJoystick.mm b/Source/Core/InputCommon/Src/ControllerInterface/OSX/OSXJoystick.mm
index 60c0cc8c50..0d89c2e393 100644
--- a/Source/Core/InputCommon/Src/ControllerInterface/OSX/OSXJoystick.mm
+++ b/Source/Core/InputCommon/Src/ControllerInterface/OSX/OSXJoystick.mm
@@ -121,7 +121,9 @@ Joystick::Axis::Axis(IOHIDElementRef element, IOHIDDeviceRef device, direction d
// Need to parse the element a bit first
std::string description("unk");
- switch (IOHIDElementGetUsage(m_element)) {
+ int const usage = IOHIDElementGetUsage(m_element);
+ switch (usage)
+ {
case kHIDUsage_GD_X:
description = "X";
break;
@@ -146,6 +148,13 @@ Joystick::Axis::Axis(IOHIDElementRef element, IOHIDDeviceRef device, direction d
case kHIDUsage_Csmr_ACPan:
description = "Pan";
break;
+ default:
+ {
+ std::ostringstream s;
+ s << usage;
+ description = s.str();
+ break;
+ }
}
m_name = std::string("Axis ") + description;