diff --git a/Source/Core/InputCommon/ControllerInterface/Quartz/Quartz.h b/Source/Core/InputCommon/ControllerInterface/Quartz/Quartz.h index 779ab8090e..3e08410f6b 100644 --- a/Source/Core/InputCommon/ControllerInterface/Quartz/Quartz.h +++ b/Source/Core/InputCommon/ControllerInterface/Quartz/Quartz.h @@ -1,4 +1,4 @@ -// Copyright 2010 Dolphin Emulator Project +// Copyright 2016 Dolphin Emulator Project // Licensed under GPLv2+ // Refer to the license.txt file included. diff --git a/Source/Core/InputCommon/ControllerInterface/Quartz/Quartz.mm b/Source/Core/InputCommon/ControllerInterface/Quartz/Quartz.mm index 651b82feac..99b31bf3ef 100644 --- a/Source/Core/InputCommon/ControllerInterface/Quartz/Quartz.mm +++ b/Source/Core/InputCommon/ControllerInterface/Quartz/Quartz.mm @@ -1,19 +1,11 @@ -// Copyright 2013 Dolphin Emulator Project +// Copyright 2016 Dolphin Emulator Project // Licensed under GPLv2+ // Refer to the license.txt file included. -#include -#include -#include - -#include "Common/StringUtil.h" - #include "InputCommon/ControllerInterface/ControllerInterface.h" #include "InputCommon/ControllerInterface/Quartz/Quartz.h" #include "InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.h" -#include - namespace ciface { namespace Quartz @@ -26,5 +18,5 @@ void Init(void* window) void DeInit() { } -} -} +} // namespace Quartz +} // namespace ciface diff --git a/Source/Core/InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.h b/Source/Core/InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.h index 00ede72726..209e6d8436 100644 --- a/Source/Core/InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.h +++ b/Source/Core/InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.h @@ -1,9 +1,11 @@ -// Copyright 2010 Dolphin Emulator Project +// Copyright 2016 Dolphin Emulator Project // Licensed under GPLv2+ // Refer to the license.txt file included. #pragma once +#include + #include "InputCommon/ControllerInterface/Device.h" namespace ciface @@ -16,7 +18,7 @@ private: class Key : public Input { public: - Key(CGKeyCode keycode); + explicit Key(CGKeyCode keycode); std::string GetName() const override; ControlState GetState() const override; @@ -45,7 +47,7 @@ private: class Button : public Input { public: - Button(CGMouseButton button) : m_button(button) {} + explicit Button(CGMouseButton button) : m_button(button) {} std::string GetName() const override; ControlState GetState() const override; @@ -56,7 +58,7 @@ private: public: void UpdateInput() override; - KeyboardAndMouse(void* window); + explicit KeyboardAndMouse(void* window); std::string GetName() const override; std::string GetSource() const override; @@ -69,5 +71,5 @@ private: uint32_t m_windowid; }; -} -} +} // namespace Quartz +} // namespace ciface diff --git a/Source/Core/InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.mm b/Source/Core/InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.mm index e996b63d56..d3a8b8d535 100644 --- a/Source/Core/InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.mm +++ b/Source/Core/InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.mm @@ -1,4 +1,4 @@ -// Copyright 2014 Dolphin Emulator Project +// Copyright 2016 Dolphin Emulator Project // Licensed under GPLv2+ // Refer to the license.txt file included. @@ -6,7 +6,6 @@ #include #include -#include #include "InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.h" @@ -87,7 +86,6 @@ KeyboardAndMouse::Key::Key(CGKeyCode keycode) : m_keycode(keycode) {kVK_F10, "F10"}, {kVK_F11, "F11"}, {kVK_F12, "F12"}, - // {kHIDUsage_KeyboardInsert, "Insert"}, {kVK_Home, "Home"}, {kVK_PageUp, "Page Up"}, {kVK_ForwardDelete, "Delete"}, @@ -113,17 +111,14 @@ KeyboardAndMouse::Key::Key(CGKeyCode keycode) : m_keycode(keycode) {kVK_ANSI_Keypad9, "Keypad 9"}, {kVK_ANSI_Keypad0, "Keypad 0"}, {kVK_ANSI_KeypadDecimal, "Keypad ."}, - // {kHIDUsage_KeyboardNonUSBackslash, "Paragraph"}, {kVK_ANSI_KeypadEquals, "Keypad ="}, - // {kHIDUsage_KeypadComma, "Keypad ,"}, {kVK_Control, "Left Control"}, {kVK_Shift, "Left Shift"}, {kVK_Option, "Left Alt"}, - {kVK_Command, "Left Command"}, + {kVK_Command, "Command"}, {kVK_RightControl, "Right Control"}, {kVK_RightShift, "Right Shift"}, {kVK_RightOption, "Right Alt"}, - // {kVK_RightCommand, "Right Command"}, }; for (auto& named_key : named_keys) @@ -170,16 +165,16 @@ KeyboardAndMouse::KeyboardAndMouse(void* window) void KeyboardAndMouse::UpdateInput() { CGRect bounds = CGRectZero; - uint32_t windowid[1] = {m_windowid}; + CGWindowID windowid[1] = {m_windowid}; CFArrayRef windowArray = CFArrayCreate(nullptr, (const void**)windowid, 1, nullptr); CFArrayRef windowDescriptions = CGWindowListCreateDescriptionFromArray(windowArray); CFDictionaryRef windowDescription = - (CFDictionaryRef)CFArrayGetValueAtIndex((CFArrayRef)windowDescriptions, 0); + static_cast(CFArrayGetValueAtIndex(windowDescriptions, 0)); if (CFDictionaryContainsKey(windowDescription, kCGWindowBounds)) { CFDictionaryRef boundsDictionary = - (CFDictionaryRef)CFDictionaryGetValue(windowDescription, kCGWindowBounds); + static_cast(CFDictionaryGetValue(windowDescription, kCGWindowBounds)); if (boundsDictionary != nullptr) CGRectMakeWithDictionaryRepresentation(boundsDictionary, &bounds); @@ -216,7 +211,6 @@ ControlState KeyboardAndMouse::Cursor::GetState() const ControlState KeyboardAndMouse::Button::GetState() const { return CGEventSourceButtonState(kCGEventSourceStateHIDSystemState, m_button) != 0; - // return (m_button != 0); } std::string KeyboardAndMouse::Cursor::GetName() const @@ -237,5 +231,5 @@ std::string KeyboardAndMouse::Button::GetName() const return "Right Click"; return std::string("Click ") + char('0' + m_button); } -} -} +} // namespace Quartz +} // namespace ciface