summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerInterface/OSX
diff options
context:
space:
mode:
authorScott Mansell <phiren@gmail.com>2016-07-12 14:44:47 +1200
committerGitHub <noreply@github.com>2016-07-12 14:44:47 +1200
commit6b48b62872d32ae33bbc364fa73f205d4ed8ac86 (patch)
tree7687661dc71890c8cb8d47fcb4df8f2667355f50 /Source/Core/InputCommon/ControllerInterface/OSX
parentf59b8b7536131c7d7bd6375ab4090ed076b4fca2 (diff)
parente0839a94781db6d62fbe26b90243a035c376cd6e (diff)
Merge pull request #3973 from phire/StripSpaces
Strip whitespace from Evdev and OSX controller names.
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/OSX')
-rw-r--r--Source/Core/InputCommon/ControllerInterface/OSX/OSX.mm4
-rw-r--r--Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm5
2 files changed, 6 insertions, 3 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/OSX/OSX.mm b/Source/Core/InputCommon/ControllerInterface/OSX/OSX.mm
index 48580cf98b..25caec2c4f 100644
--- a/Source/Core/InputCommon/ControllerInterface/OSX/OSX.mm
+++ b/Source/Core/InputCommon/ControllerInterface/OSX/OSX.mm
@@ -6,6 +6,8 @@
#include <Foundation/Foundation.h>
#include <IOKit/hid/IOHIDLib.h>
+#include "Common/StringUtil.h"
+
#include "InputCommon/ControllerInterface/ControllerInterface.h"
#include "InputCommon/ControllerInterface/OSX/OSX.h"
#include "InputCommon/ControllerInterface/OSX/OSXJoystick.h"
@@ -137,7 +139,7 @@ static void DeviceMatching_callback(void* inContext, IOReturn inResult, void* in
IOHIDDeviceRef inIOHIDDeviceRef)
{
NSString* pName = (NSString*)IOHIDDeviceGetProperty(inIOHIDDeviceRef, CFSTR(kIOHIDProductKey));
- std::string name = (pName != nullptr) ? [pName UTF8String] : "Unknown device";
+ std::string name = (pName != nullptr) ? StripSpaces([pName UTF8String]) : "Unknown device";
DeviceDebugPrint(inIOHIDDeviceRef);
diff --git a/Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm b/Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm
index 7eb05a52ce..06c883ac4e 100644
--- a/Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm
+++ b/Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm
@@ -7,6 +7,7 @@
#include <Foundation/Foundation.h>
#include <IOKit/hid/IOHIDLib.h>
+#include "Common/StringUtil.h"
#include "InputCommon/ControllerInterface/OSX/OSXJoystick.h"
namespace ciface
@@ -110,7 +111,7 @@ std::string Joystick::Button::GetName() const
{
std::ostringstream s;
s << IOHIDElementGetUsage(m_element);
- return std::string("Button ") + s.str();
+ return std::string("Button ") + StripSpaces(s.str());
}
Joystick::Axis::Axis(IOHIDElementRef element, IOHIDDeviceRef device, direction dir)
@@ -150,7 +151,7 @@ Joystick::Axis::Axis(IOHIDElementRef element, IOHIDDeviceRef device, direction d
{
std::ostringstream s;
s << usage;
- description = s.str();
+ description = StripSpaces(s.str());
break;
}
}