summaryrefslogtreecommitdiff
path: root/tvapi/libtv/tvutils/CTvInput.h (plain)
blob: bb2bce15104d02d71dadda774a4d2a4c7c4ac250
1#ifndef _TV_INPUT_H
2#define _TV_INPUT_H
3#include <linux/input.h>
4#
5#include "CThread.h"
6static const char *KEY_EVENT_0 = "/dev/input/event0";
7static const char *KEY_EVENT_1 = "/dev/input/event1";
8static const char *KEY_EVENT_2 = "/dev/input/event2";
9class CTvInput: public CThread {
10public:
11 CTvInput();
12 ~CTvInput();
13 void sendkeyEvent(const int &type, const int &code, const int &value);
14 void sendIRkeyEvent(const int &type, const int &code, const int &value);
15 void sendkeyCode(const int &code);
16 void sendkeyCode_Up(const int &code);
17 void sendkeyCode_Down(const int &code);
18 void sendIRkeyCode(const int &code);
19 void sendIRkeyCode_Up(const int &code);
20 void sendIRkeyCode_Down(const int &code);
21 void sendKeyRepeatStart(const int &code, int disTime, int repeatDisTime);//ms
22 void sendKeyRepeatStop();
23 nsecs_t getNowMs();
24
25private:
26 bool threadLoop();
27
28 int mKeyEventFd;
29 int mKeyEventFd_IR;
30 CCondition mSendKeyCondition;
31 CMutex mLock;
32 int mRepeatKeyCode;
33 int mRepeatKeydisTime;
34 int mRepeatKeyRepeateDisTime;
35 int mTimeoutCount;
36 nsecs_t mWhenTimeRepeatKeyStartToSend;
37};
38#endif
39