forked from huceke/omxplayer
-
Notifications
You must be signed in to change notification settings - Fork 332
/
Copy pathKeyboard.h
31 lines (29 loc) · 768 Bytes
/
Keyboard.h
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
#define OMXPLAYER_DBUS_PATH_SERVER "/org/mpris/MediaPlayer2"
#define OMXPLAYER_DBUS_INTERFACE_ROOT "org.mpris.MediaPlayer2"
#define OMXPLAYER_DBUS_INTERFACE_PLAYER "org.mpris.MediaPlayer2.Player"
#include "OMXThread.h"
#include <map>
class Keyboard : public OMXThread
{
protected:
struct termios orig_termios;
int orig_fl;
int m_action;
DBusConnection *conn;
std::map<int,int> m_keymap;
std::string m_dbus_name;
public:
Keyboard();
~Keyboard();
void Close();
void Process();
void setKeymap(std::map<int,int> keymap);
void setDbusName(std::string dbus_name);
void Sleep(unsigned int dwMilliSeconds);
int getEvent();
private:
void restore_term();
void send_action(int action);
int dbus_connect();
void dbus_disconnect();
};