aboutsummaryrefslogtreecommitdiff
path: root/lib/driver/rcsdl.h
blob: 9732f5e49ca8fd9740f2447e4674a58dbfe34358 (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
#ifndef __lib_driver_rcsdl_h
#define __lib_driver_rcsdl_h

#include <lib/driver/rc.h>

#include <SDL.h>

class eSDLInputDevice : public eRCDevice
{
private:
	bool m_escape;
	unsigned int m_unicode;
	int translateKey(SDLKey key);

public:
	eSDLInputDevice(eRCDriver *driver);
	~eSDLInputDevice();

	virtual void handleCode(long arg);
	virtual const char *getDescription() const;
};

class eSDLInputDriver : public eRCDriver
{
private:
	static eSDLInputDriver *instance;

public:
	eSDLInputDriver();
	~eSDLInputDriver();

	static eSDLInputDriver *getInstance() { return instance; }

	void keyPressed(const SDL_KeyboardEvent *key);
};

#endif