Author: titmuss
Date: Mon Apr 28 07:10:39 2008
New Revision: 2377

URL: http://svn.slimdevices.com?rev=2377&root=Jive&view=rev
Log:
Bug: N/A
Description:
Allow a little play for the mouse press/hold events.

Modified:
    7.2/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework.c

Modified: 7.2/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework.c
URL: 
http://svn.slimdevices.com/7.2/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework.c?rev=2377&root=Jive&r1=2376&r2=2377&view=diff
==============================================================================
--- 7.2/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework.c (original)
+++ 7.2/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework.c Mon Apr 28 
07:10:39 2008
@@ -63,6 +63,8 @@
 static SDL_TimerID key_timer = NULL;
 
 static SDL_TimerID mouse_timer = NULL;
+
+static Uint16 mouse_origin_x, mouse_origin_y;
 
 static struct jive_keymap keymap[] = {
        { SDLK_RIGHT,           JIVE_KEY_GO },
@@ -998,6 +1000,9 @@
 
                                param = (event->button.y << 16) | 
event->button.x;
                                mouse_timer = SDL_AddTimer(HOLD_TIMEOUT, 
&mousehold_callback, (void *) param);
+
+                               mouse_origin_x = event->button.x;
+                               mouse_origin_y = event->button.y;
                                break;
                        }
                }
@@ -1027,7 +1032,10 @@
 
        case SDL_MOUSEMOTION:
                if (event->motion.state & SDL_BUTTON(1)) {
-                       if (mouse_state != MOUSE_STATE_SENT) {
+                       if ( (mouse_state == MOUSE_STATE_DOWN
+                              && (abs(mouse_origin_x - event->motion.x) > 10
+                                  || abs(mouse_origin_y - event->motion.y) > 
10))
+                            || mouse_state == MOUSE_STATE_DRAG) {
                                jevent.type = JIVE_EVENT_MOUSE_DRAG;
                                jevent.u.mouse.x = event->motion.x;
                                jevent.u.mouse.y = event->motion.y;

_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/cgi-bin/mailman/listinfo/jive-checkins

Reply via email to