Merge pull request #4405 from xrix4096/mac-unknown-joyaxis
Make analog triggers on PS3 controllers accessible on Mac
This commit is contained in:
commit
b9e4f67d3a
|
@ -144,8 +144,14 @@ Joystick::Axis::Axis(IOHIDElementRef element, IOHIDDeviceRef device, direction d
|
||||||
break;
|
break;
|
||||||
default:
|
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;
|
std::ostringstream s;
|
||||||
s << usage;
|
s << "CK-";
|
||||||
|
s << elementCookie;
|
||||||
description = StripSpaces(s.str());
|
description = StripSpaces(s.str());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue