mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-28 11:49:06 +00:00
Strip whitespace from Evdev and OSX controller names.
This commit is contained in:
parent
f59b8b7536
commit
e0839a9478
3 changed files with 10 additions and 6 deletions
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue