-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathUinputManager.h
More file actions
55 lines (49 loc) · 1.12 KB
/
Copy pathUinputManager.h
File metadata and controls
55 lines (49 loc) · 1.12 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef UINPUT_MANAGER_H
#define UINPUT_MANAGER_H
#include <fcntl.h>
#include <errno.h>
#include <dirent.h>
#include <math.h>
#include <time.h>
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <utils/RefBase.h>
#include <cutils/log.h>
#include <string.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <linux/input.h>
#include <linux/uinput.h>
#include <malloc.h>
#include <stdint.h>
#define KEYDOWN 1
#define KEYUP 0
#define TOUCHDOWN 1
#define TOUCHUP 0
#define ROTATING_90 1
#define ROTATING_180 2
#define ROTATING_270 3
class UinputManager{
private:
int fd_keyboard;
int fd_mouse;
int fd_touch;
int width;
int height;
void adapterxy(int &x,int &y,int ori);
public:
UinputManager();
virtual ~UinputManager();
int createKeyboardDevice();
int handleKey(int keycode,int status);
int createMouseDevice();
int handleMouseMove(int RelX,int RelY);
int handleMouseKey(int status,int keycode);
int createTouchDevice();
int handleTouch(int type,int x,int y,int ori,int touchcode);
};
#endif