summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerInterface/evdev
diff options
context:
space:
mode:
authorScott Mansell <phiren@gmail.com>2016-07-01 15:05:24 +1200
committerScott Mansell <phiren@gmail.com>2016-07-12 14:19:07 +1200
commite0839a94781db6d62fbe26b90243a035c376cd6e (patch)
tree7687661dc71890c8cb8d47fcb4df8f2667355f50 /Source/Core/InputCommon/ControllerInterface/evdev
parentf59b8b7536131c7d7bd6375ab4090ed076b4fca2 (diff)
Strip whitespace from Evdev and OSX controller names.
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/evdev')
-rw-r--r--Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp b/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp
index 1e5f702b70..49827369f6 100644
--- a/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp
+++ b/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp
@@ -10,6 +10,7 @@
#include "Common/Assert.h"
#include "Common/Logging/Log.h"
#include "Common/MathUtil.h"
+#include "Common/StringUtil.h"
#include "InputCommon/ControllerInterface/ControllerInterface.h"
#include "InputCommon/ControllerInterface/evdev/evdev.h"
@@ -97,7 +98,7 @@ evdevDevice::evdevDevice(const std::string& devnode, int id) : m_devfile(devnode
return;
}
- m_name = libevdev_get_name(m_dev);
+ m_name = StripSpaces(libevdev_get_name(m_dev));
// Controller buttons (and keyboard keys)
int num_buttons = 0;
@@ -165,7 +166,7 @@ std::string evdevDevice::Button::GetName() const
{
const char* name = libevdev_event_code_get_name(EV_KEY, m_code);
if (name)
- return std::string(name);
+ return StripSpaces(name);
}
// But controllers use codes above 0x100, and the standard label often doesn't match.
// We are better off with Button 0 and so on.
@@ -223,7 +224,7 @@ std::string evdevDevice::ForceFeedback::GetName() const
{
const char* name = libevdev_event_code_get_name(EV_FF, m_type);
if (name)
- return std::string(name);
+ return StripSpaces(name);
return "Unknown";
}
}