blob: 92c981c5b07c17a2546a7566a757e7ea227be90c
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 | #ifdef ADC_USE_KEY_EVENT0 |
8 | static const char *KEY_EVENT_1 = "/dev/input/event0"; |
9 | #else |
10 | static const char *KEY_EVENT_1 = "/dev/input/event1"; |
11 | #endif |
12 | static const char *KEY_EVENT_2 = "/dev/input/event2"; |
13 | class CTvInput: public CThread { |
14 | public: |
15 | CTvInput(); |
16 | ~CTvInput(); |
17 | void sendkeyEvent(const int &type, const int &code, const int &value); |
18 | void sendIRkeyEvent(const int &type, const int &code, const int &value); |
19 | void sendkeyCode(const int &code); |
20 | void sendkeyCode_Up(const int &code); |
21 | void sendkeyCode_Down(const int &code); |
22 | void sendIRkeyCode(const int &code); |
23 | void sendIRkeyCode_Up(const int &code); |
24 | void sendIRkeyCode_Down(const int &code); |
25 | void sendKeyRepeatStart(const int &code, int disTime, int repeatDisTime);//ms |
26 | void sendKeyRepeatStop(); |
27 | nsecs_t getNowMs(); |
28 | |
29 | private: |
30 | bool threadLoop(); |
31 | |
32 | int mKeyEventFd; |
33 | int mKeyEventFd_IR; |
34 | CCondition mSendKeyCondition; |
35 | CMutex mLock; |
36 | int mRepeatKeyCode; |
37 | int mRepeatKeydisTime; |
38 | int mRepeatKeyRepeateDisTime; |
39 | int mTimeoutCount; |
40 | nsecs_t mWhenTimeRepeatKeyStartToSend; |
41 | }; |
42 | #endif |
43 |