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();