dolphin/Source/Core/InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

73 lines
1.5 KiB
C
Raw Normal View History

2016-08-09 22:48:22 +00:00
// Copyright 2016 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#pragma once
2016-08-09 22:48:22 +00:00
#include <QuartzCore/QuartzCore.h>
#include "Common/Matrix.h"
#include "InputCommon/ControllerInterface/Device.h"
namespace ciface::Quartz
{
std::string KeycodeToName(const CGKeyCode keycode);
class KeyboardAndMouse : public Core::Device
{
private:
class Key : public Input
{
public:
2016-08-09 22:48:22 +00:00
explicit 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() const 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:
2016-08-09 22:48:22 +00:00
explicit Button(CGMouseButton button) : m_button(button) {}
std::string GetName() const override;
ControlState GetState() const override;
private:
CGMouseButton m_button;
};
public:
void UpdateInput() override;
2016-08-09 22:48:22 +00:00
explicit KeyboardAndMouse(void* window);
std::string GetName() const override;
std::string GetSource() const override;
private:
Common::Vec2 m_cursor;
uint32_t m_windowid;
};
} // namespace ciface::Quartz