-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
71 lines (67 loc) · 1.74 KB
/
main.c
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#include <stdio.h>
#include <stdint.h>
#include <unistd.h>
#include <signal.h>
#include <sys/time.h>
#include "touch.h"
void touch_handle(touch_struct *touch_data)
{
uint16_t m_event = touch_data->type;
/*单击*/
if(0 != (m_event & TOUCH_CLICK))
{
printf("操作:单击,坐标:(%d,%d)\n",
touch_data->one_clickData.x,
touch_data->one_clickData.y);
}
/*双击*/
else if(0 != (m_event & TOUCH_DOUBLECLICK))
{
printf("操作:双击,坐标:(%d,%d)\n",
touch_data->one_clickData.x,
touch_data->one_clickData.y);
}
/*长按*/
else if(0 != (m_event & TOUCH_PRESS))
{
printf("操作:长按,坐标:(%d,%d)\n",
touch_data->one_clickData.x,
touch_data->one_clickData.y);
}
/*移动*/
else if(0 != (m_event & TOUCH_MOVE))
{
printf("操作:移动,坐标:(%d,%d),坐标偏移:(%d,%d)\n",
touch_data->one_clickData.x,
touch_data->one_clickData.y,
touch_data->one_clickData.offset_x,
touch_data->one_clickData.offset_y);
}
/*放大*/
else if(0 != (m_event & TOUCH_MAGNIFY))
{
printf("操作:放大,中心坐标:(%d,%d),距离偏移:%d\n",
touch_data->more_clickData.centre_x,
touch_data->more_clickData.centre_y,
touch_data->more_clickData.offset_distance);
}
/*缩小*/
else if(0 != (m_event & TOUCH_SHRINK))
{
printf("操作:缩小,中心坐标:(%d,%d),距离偏移:%d\n",
touch_data->more_clickData.centre_x,
touch_data->more_clickData.centre_y,
touch_data->more_clickData.offset_distance);
}
}
void handle()
{
printf("test\n");
}
int main()
{
while(1)
{
touch_process(touch_handle);
}
}