提交 4190cf58 编写于 作者: qiuyiuestc's avatar qiuyiuestc

[mini2440]fix no down event problem, ugly implement,need consider move event

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@539 bbd45198-f89e-11dd-88c7-29a3b14d5316
上级 04428f9a
...@@ -69,20 +69,20 @@ static struct s3c2410ts ts; ...@@ -69,20 +69,20 @@ static struct s3c2410ts ts;
#include <rtgui/event.h> #include <rtgui/event.h>
void report_touch_input(int updown) void report_touch_input(int updown)
{ {
long tmp; long xp, yp;
struct rtgui_event_mouse emouse; struct rtgui_event_mouse emouse;
ts.xp >>= ts.shift; xp = ts.xp >> ts.shift;
ts.yp >>= ts.shift; yp = ts.yp >> ts.shift;
ts.xp = 240 * (ts.xp-X_MIN)/(X_MAX-X_MIN); xp = 240 * (xp-X_MIN)/(X_MAX-X_MIN);
ts.yp = 320 - (320*(ts.yp-Y_MIN)/(Y_MAX-Y_MIN)); yp = 320 - (320*(yp-Y_MIN)/(Y_MAX-Y_MIN));
emouse.parent.type = RTGUI_EVENT_MOUSE_BUTTON; emouse.parent.type = RTGUI_EVENT_MOUSE_BUTTON;
emouse.parent.sender = RT_NULL; emouse.parent.sender = RT_NULL;
emouse.x = ts.xp; emouse.x = xp;
emouse.y = ts.yp; emouse.y = yp;
/* set emouse button */ /* set emouse button */
if (updown) if (updown)
...@@ -95,7 +95,7 @@ void report_touch_input(int updown) ...@@ -95,7 +95,7 @@ void report_touch_input(int updown)
} }
/* rt_kprintf("touch %s: ts.x: %d, ts.y: %d, count:%d\n", updown? "down" : "up", /* rt_kprintf("touch %s: ts.x: %d, ts.y: %d, count:%d\n", updown? "down" : "up",
ts.xp, ts.yp, ts.count); */ xp, yp, ts.count); */
emouse.button |= RTGUI_MOUSE_BUTTON_LEFT; emouse.button |= RTGUI_MOUSE_BUTTON_LEFT;
...@@ -170,6 +170,7 @@ void s3c2410_intc_stylus_updown() ...@@ -170,6 +170,7 @@ void s3c2410_intc_stylus_updown()
if (ts.xp >= 0 && ts.yp >= 0) if (ts.xp >= 0 && ts.yp >= 0)
{ {
#ifdef RT_USING_RTGUI #ifdef RT_USING_RTGUI
report_touch_input(1);
report_touch_input(0); report_touch_input(0);
first_down_report = 1; first_down_report = 1;
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册