Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Number "unknown" axes in OSX rather than call them all "unk".
  • Loading branch information
jordan-woyak committed Feb 5, 2013
1 parent 937d9e9 commit f506783
Showing 1 changed file with 10 additions and 1 deletion.
Expand Up @@ -121,7 +121,9 @@
// 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;
Expand All @@ -146,6 +148,13 @@
case kHIDUsage_Csmr_ACPan:
description = "Pan";
break;
default:
{
std::ostringstream s;
s << usage;
description = s.str();
break;
}
}

m_name = std::string("Axis ") + description;
Expand Down

0 comments on commit f506783

Please sign in to comment.