SDL: add input support, use SDL mainloop in a thread
[enigma2.git] / lib / driver / rcsdl.h
diff --git a/lib/driver/rcsdl.h b/lib/driver/rcsdl.h
new file mode 100644 (file)
index 0000000..9732f5e
--- /dev/null
@@ -0,0 +1,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