summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerInterface
diff options
context:
space:
mode:
authorMarkus Wick <degasus@users.noreply.github.com>2016-10-31 13:01:47 +0100
committerGitHub <noreply@github.com>2016-10-31 13:01:47 +0100
commitb9e4f67d3a5783566799202612a5edfbdc4a260f (patch)
treeaac5d046b8b49caaba10647835c3c3c02f5c4443 /Source/Core/InputCommon/ControllerInterface
parent2afa877119b0914afdd7d99e7b31df1760f49413 (diff)
parent9da9ba616b7d9fc843a62120bb11e66b0374c6bd (diff)
Merge pull request #4405 from xrix4096/mac-unknown-joyaxis
Make analog triggers on PS3 controllers accessible on Mac
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface')
-rw-r--r--Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm8
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm b/Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm
index 204e002e25..19aa9e23b7 100644
--- a/Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm
+++ b/Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm
@@ -144,8 +144,14 @@ Joystick::Axis::Axis(IOHIDElementRef element, IOHIDDeviceRef device, direction d
break;
default:
{
+ IOHIDElementCookie elementCookie = IOHIDElementGetCookie(m_element);
+ // This axis isn't a 'well-known' one so cook a descriptive and uniquely
+ // identifiable name. macOS provides a 'cookie' for each element that
+ // will persist between sessions and identify the same physical controller
+ // element so we can use that as a component of the axis name
std::ostringstream s;
- s << usage;
+ s << "CK-";
+ s << elementCookie;
description = StripSpaces(s.str());
break;
}