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