forked from enlightenment/efl
aaagh ecore_fb needs double/triple fix too.
SVN revision: 53012
This commit is contained in:
parent
a77152c531
commit
6893412d80
|
@ -96,6 +96,8 @@ struct _Ecore_Fb_Event_Mouse_Button_Up /** FB Mouse Up event */
|
|||
int button; /**< Mouse button that was released (1 - 32) */
|
||||
int x; /**< Mouse co-ordinates when mouse button was raised */
|
||||
int y; /**< Mouse co-ordinates when mouse button was raised */
|
||||
int double_click : 1; /**< Set if click was a double click */
|
||||
int triple_click : 1; /**< Set if click was a triple click */
|
||||
};
|
||||
|
||||
struct _Ecore_Fb_Event_Mouse_Move /** FB Mouse Move event */
|
||||
|
|
|
@ -54,7 +54,8 @@ _ecore_fb_ps2_fd_handler(void *data __UNUSED__, Ecore_Fd_Handler *fd_handler __U
|
|||
int num;
|
||||
char *ptr;
|
||||
double t;
|
||||
int did_triple = 0;
|
||||
static int did_double = 0;
|
||||
static int did_triple = 0;
|
||||
|
||||
ptr = (char *)&(_ecore_fb_ps2_event);
|
||||
ptr += _ecore_fb_ps2_event_byte_count;
|
||||
|
@ -105,14 +106,26 @@ _ecore_fb_ps2_fd_handler(void *data __UNUSED__, Ecore_Fd_Handler *fd_handler __U
|
|||
if (!e) goto retry;
|
||||
e->x = x;
|
||||
e->y = y;
|
||||
e->button = 1;
|
||||
e->button = i;
|
||||
if ((t - last_time) <= _ecore_fb_double_click_time)
|
||||
{
|
||||
e->double_click = 1;
|
||||
did_double = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
did_double = 0;
|
||||
did_triple = 0;
|
||||
}
|
||||
if ((t - last_last_time) <= (2 * _ecore_fb_double_click_time))
|
||||
{
|
||||
did_triple = 1;
|
||||
e->triple_click = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
did_triple = 0;
|
||||
}
|
||||
ecore_event_add(ECORE_FB_EVENT_MOUSE_BUTTON_DOWN, e, NULL, NULL);
|
||||
}
|
||||
else if ((!(button & mask)) && ((prev_button & mask)))
|
||||
|
@ -124,7 +137,11 @@ _ecore_fb_ps2_fd_handler(void *data __UNUSED__, Ecore_Fd_Handler *fd_handler __U
|
|||
if (!e) goto retry;
|
||||
e->x = x;
|
||||
e->y = y;
|
||||
e->button = 1;
|
||||
e->button = i;
|
||||
if (did_double)
|
||||
e->double_click = 1;
|
||||
if (did_triple)
|
||||
e->triple_click = 1;
|
||||
ecore_event_add(ECORE_FB_EVENT_MOUSE_BUTTON_UP, e, NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -211,7 +211,8 @@ _ecore_fb_ts_fd_handler(void *data __UNUSED__, Ecore_Fd_Handler *fd_handler __UN
|
|||
int num;
|
||||
char *ptr;
|
||||
double t = 0.0;
|
||||
int did_triple = 0;
|
||||
static int did_double = 0;
|
||||
static int did_triple = 0;
|
||||
|
||||
#ifdef HAVE_TSLIB
|
||||
if (_ecore_fb_ts_apply_cal)
|
||||
|
@ -269,12 +270,24 @@ _ecore_fb_ts_fd_handler(void *data __UNUSED__, Ecore_Fd_Handler *fd_handler __UN
|
|||
e->y = y;
|
||||
e->button = 1;
|
||||
if ((t - last_time) <= _ecore_fb_double_click_time)
|
||||
{
|
||||
e->double_click = 1;
|
||||
did_double = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
did_double = 0;
|
||||
did_triple = 0;
|
||||
}
|
||||
if ((t - last_last_time) <= (2 * _ecore_fb_double_click_time))
|
||||
{
|
||||
did_triple = 1;
|
||||
e->triple_click = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
did_triple = 0;
|
||||
}
|
||||
ecore_event_add(ECORE_FB_EVENT_MOUSE_BUTTON_DOWN, e, NULL, NULL);
|
||||
}
|
||||
else if ((!pressure) && (prev_pressure))
|
||||
|
@ -287,6 +300,10 @@ _ecore_fb_ts_fd_handler(void *data __UNUSED__, Ecore_Fd_Handler *fd_handler __UN
|
|||
e->x = prev_x;
|
||||
e->y = prev_y;
|
||||
e->button = 1;
|
||||
if (did_double)
|
||||
e->double_click = 1;
|
||||
if (did_triple)
|
||||
e->triple_click = 1;
|
||||
ecore_event_add(ECORE_FB_EVENT_MOUSE_BUTTON_UP, e, NULL, NULL);
|
||||
}
|
||||
if (did_triple)
|
||||
|
|
Loading…
Reference in New Issue