summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerInterface
diff options
context:
space:
mode:
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;
}