summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/Src/ControllerInterface/OSX/OSXKeyboard.h
blob: 1a7fcd045befad6440b18862fbbe47f16088d04e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include <IOKit/hid/IOHIDLib.h>

#include "../ControllerInterface.h"

namespace ciface
{
namespace OSX
{

class Keyboard : public ControllerInterface::Device
{
private:
	class Key : public Input
	{
	public:
		std::string GetName() const;
		Key(IOHIDElementRef element, IOHIDDeviceRef device);
		ControlState GetState() const;
	private:
		const IOHIDElementRef	m_element;
		const IOHIDDeviceRef	m_device;
		std::string		m_name;
	};

public:
	bool UpdateInput();
	bool UpdateOutput();

	Keyboard(IOHIDDeviceRef device, std::string name, int index);

	std::string GetName() const;
	std::string GetSource() const;
	int GetId() const;

private:
	const IOHIDDeviceRef	m_device;
	const std::string	m_device_name;
	int		m_index;
};

}
}