summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerInterface
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2014-08-30 16:44:28 -0400
committerLioncash <mathew1800@gmail.com>2014-08-30 18:06:44 -0400
commitbc14d6966f996c482ea97aa9b424e34091bfc8ec (patch)
tree0397974a802fafe9e9c0d000ab03c92503bd5257 /Source/Core/InputCommon/ControllerInterface
parent55a0034dd569898dfa3d920438b22193ac25da9a (diff)
InputCommon: Clean up brace placements
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface')
-rw-r--r--Source/Core/InputCommon/ControllerInterface/ExpressionParser.cpp6
-rw-r--r--Source/Core/InputCommon/ControllerInterface/OSX/OSX.mm6
-rw-r--r--Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm13
-rw-r--r--Source/Core/InputCommon/ControllerInterface/OSX/OSXKeyboard.mm12
4 files changed, 25 insertions, 12 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/ExpressionParser.cpp b/Source/Core/InputCommon/ControllerInterface/ExpressionParser.cpp
index da740bbb7e..c28356260d 100644
--- a/Source/Core/InputCommon/ControllerInterface/ExpressionParser.cpp
+++ b/Source/Core/InputCommon/ControllerInterface/ExpressionParser.cpp
@@ -136,7 +136,8 @@ public:
std::string name;
name += c;
- while (it != expr.end()) {
+ while (it != expr.end())
+ {
c = *it;
if (!isalpha(c))
break;
@@ -569,7 +570,8 @@ ExpressionParseStatus ParseExpression(std::string str, ControlFinder &finder, Ex
qualifier.has_device = false;
Device::Control *control = finder.FindControl(qualifier);
- if (control) {
+ if (control)
+ {
*expr_out = new Expression(new ControlExpression(qualifier, control));
return EXPRESSION_PARSE_SUCCESS;
}
diff --git a/Source/Core/InputCommon/ControllerInterface/OSX/OSX.mm b/Source/Core/InputCommon/ControllerInterface/OSX/OSX.mm
index ac98c4c13d..9d73106c6e 100644
--- a/Source/Core/InputCommon/ControllerInterface/OSX/OSX.mm
+++ b/Source/Core/InputCommon/ControllerInterface/OSX/OSX.mm
@@ -30,7 +30,8 @@ void DeviceElementDebugPrint(const void *value, void *context)
recurse = *(bool*)context;
std::string type = "";
- switch (IOHIDElementGetType(e)) {
+ switch (IOHIDElementGetType(e))
+ {
case kIOHIDElementTypeInput_Axis:
type = "axis";
break;
@@ -57,7 +58,8 @@ void DeviceElementDebugPrint(const void *value, void *context)
std::string c_type = "";
if (type == "collection")
{
- switch (IOHIDElementGetCollectionType(e)) {
+ switch (IOHIDElementGetCollectionType(e))
+ {
case kIOHIDElementCollectionTypePhysical:
c_type = "physical";
break;
diff --git a/Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm b/Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm
index f7f59e1c41..10a2c211c1 100644
--- a/Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm
+++ b/Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm
@@ -64,12 +64,15 @@ Joystick::Joystick(IOHIDDeviceRef device, std::string name, int index)
(IOHIDElementRef)CFArrayGetValueAtIndex(axes, i);
//DeviceElementDebugPrint(e, nullptr);
- if (IOHIDElementGetUsage(e) == kHIDUsage_GD_Hatswitch) {
+ if (IOHIDElementGetUsage(e) == kHIDUsage_GD_Hatswitch)
+ {
AddInput(new Hat(e, m_device, Hat::up));
AddInput(new Hat(e, m_device, Hat::right));
AddInput(new Hat(e, m_device, Hat::down));
AddInput(new Hat(e, m_device, Hat::left));
- } else {
+ }
+ else
+ {
AddAnalogInputs(new Axis(e, m_device, Axis::negative),
new Axis(e, m_device, Axis::positive));
}
@@ -212,7 +215,8 @@ Joystick::Hat::Hat(IOHIDElementRef element, IOHIDDeviceRef device, direction dir
, m_device(device)
, m_direction(dir)
{
- switch (dir) {
+ switch (dir)
+ {
case up:
m_name = "Up";
break;
@@ -239,7 +243,8 @@ ControlState Joystick::Hat::GetState() const
{
position = IOHIDValueGetIntegerValue(value);
- switch (position) {
+ switch (position)
+ {
case 0:
if (m_direction == up)
return 1;
diff --git a/Source/Core/InputCommon/ControllerInterface/OSX/OSXKeyboard.mm b/Source/Core/InputCommon/ControllerInterface/OSX/OSXKeyboard.mm
index ecb841ae7b..89642aecf0 100644
--- a/Source/Core/InputCommon/ControllerInterface/OSX/OSXKeyboard.mm
+++ b/Source/Core/InputCommon/ControllerInterface/OSX/OSXKeyboard.mm
@@ -116,7 +116,8 @@ Keyboard::Key::Key(IOHIDElementRef element, IOHIDDeviceRef device)
: m_element(element)
, m_device(device)
{
- static const struct PrettyKeys {
+ static const struct PrettyKeys
+ {
const uint32_t code;
const char *const name;
} named_keys[] = {
@@ -224,14 +225,17 @@ Keyboard::Key::Key(IOHIDElementRef element, IOHIDDeviceRef device)
{ kHIDUsage_KeyboardRightGUI, "Right Command" },
{ 184, "Eject" },
};
-
+
const uint32_t keycode = IOHIDElementGetUsage(m_element);
for (auto & named_key : named_keys)
- if (named_key.code == keycode) {
+ {
+ if (named_key.code == keycode)
+ {
m_name = named_key.name;
return;
}
-
+ }
+
std::stringstream ss;
ss << "Key " << keycode;
m_name = ss.str();