Files
dolphin/Source/Core/InputCommon/ControllerInterface/OSX/OSXKeyboard.h
T

81 lines
1.6 KiB
C++
Raw Normal View History

// Copyright 2010 Dolphin Emulator Project
2015-05-18 01:08:10 +02:00
// Licensed under GPLv2+
// Refer to the license.txt file included.
#pragma once
#include <IOKit/hid/IOHIDLib.h>
2014-02-17 05:18:15 -05:00
#include "InputCommon/ControllerInterface/Device.h"
namespace ciface
{
namespace OSX
{
2013-06-16 20:07:10 -04:00
class Keyboard : public Core::Device
{
2011-03-14 01:20:11 +00:00
private:
class Key : public Input
{
public:
Key(IOHIDElementRef element, IOHIDDeviceRef device);
std::string GetName() const override;
ControlState GetState() const override;
2014-02-16 15:30:18 -05:00
private:
const IOHIDElementRef m_element;
const IOHIDDeviceRef m_device;
std::string m_name;
};
2014-02-16 15:30:18 -05:00
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(u8 index, const unsigned char& button) : m_button(button), m_index(index) {}
std::string GetName() const override;
ControlState GetState() const override;
private:
const unsigned char& m_button;
const u8 m_index;
};
2011-03-14 01:20:11 +00:00
public:
void UpdateInput() override;
Keyboard(IOHIDDeviceRef device, std::string name, void* window);
std::string GetName() const override;
std::string GetSource() const override;
private:
struct
{
float x, y;
} m_cursor;
const IOHIDDeviceRef m_device;
const std::string m_device_name;
uint32_t m_windowid;
unsigned char m_mousebuttons[3];
};
}
}