diff options
| author | Michael Maltese <michael.joseph.maltese@gmail.com> | 2016-08-08 09:38:22 -0700 |
|---|---|---|
| committer | Michael Maltese <michael.joseph.maltese@gmail.com> | 2016-08-08 09:38:22 -0700 |
| commit | 3dc8136e1445244d8c7181d0bbb65e223728dd70 (patch) | |
| tree | dd63e024a5db39b2cfacc9d756f89099c3c153fb /Source/Core/InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.h | |
| parent | 1ab99ee22c1b6ae1b6d71aef717f277f39045067 (diff) | |
Add Quartz/CoreGraphics controller interface for default k&m events
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.h')
| -rw-r--r-- | Source/Core/InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.h | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.h b/Source/Core/InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.h new file mode 100644 index 0000000000..00ede72726 --- /dev/null +++ b/Source/Core/InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.h @@ -0,0 +1,73 @@ +// Copyright 2010 Dolphin Emulator Project +// Licensed under GPLv2+ +// Refer to the license.txt file included. + +#pragma once + +#include "InputCommon/ControllerInterface/Device.h" + +namespace ciface +{ +namespace Quartz +{ +class KeyboardAndMouse : public Core::Device +{ +private: + class Key : public Input + { + public: + Key(CGKeyCode keycode); + std::string GetName() const override; + ControlState GetState() const override; + + private: + CGKeyCode m_keycode; + std::string m_name; + }; + + class Cursor : public Input + { + public: + Cursor(u8 index, const float& axis, const bool positive) + : m_axis(axis), m_index(index), m_positive(positive) + { + } + std::string GetName() const override; + bool IsDetectable() override { return false; } + ControlState GetState() const override; + + private: + const float& m_axis; + const u8 m_index; + const bool m_positive; + }; + + class Button : public Input + { + public: + Button(CGMouseButton button) : m_button(button) {} + std::string GetName() const override; + ControlState GetState() const override; + + private: + CGMouseButton m_button; + }; + +public: + void UpdateInput() override; + + KeyboardAndMouse(void* window); + + std::string GetName() const override; + std::string GetSource() const override; + +private: + struct + { + float x, y; + } m_cursor; + + uint32_t m_windowid; +}; +} +} |
