hello
ho to catch a “double click” mouse event in SDL?
thanx
hello
ho to catch a “double click” mouse event in SDL?
thanx
youd want to do something like this…
when you get a single click:
now = SDL_GetTicks();
if last_time - now < some number
the user did a double click
else
last_time = now> ----- Original Message -----
From: lucriz@sitilandia.it (lucriz)
To:
Sent: Saturday, June 26, 2004 12:22 PM
Subject: [SDL] doble click in sdlhello
ho to catch a “double click” mouse event in SDL?
thanx
SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl
To act nicely, also check if the mouse has moved substantially, or a too
low interval between clicks, to avoid accidental double clicks.On Sun, 2004-06-27 at 00:31, Alan Wolfe wrote:
youd want to do something like this…
when you get a single click:
now = SDL_GetTicks();
if last_time - now < some number
the user did a double click
else
last_time = now
–
Petri Latvala
good point, i forgot about the mouse moving petri> ----- Original Message -----
From: adrinael@nuclearzone.org (Petri Latvala)
To: "A list for developers using the SDL library. (includes SDL-announce)"
Sent: Saturday, June 26, 2004 3:14 PM
Subject: Re: [SDL] doble click in sdlOn Sun, 2004-06-27 at 00:31, Alan Wolfe wrote:
youd want to do something like this…
when you get a single click:
now = SDL_GetTicks();
if last_time - now < some number
the user did a double click
else
last_time = nowTo act nicely, also check if the mouse has moved substantially, or a too
low interval between clicks, to avoid accidental double clicks.–
Petri Latvala
SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
lucriz wrote:
| hello
|
| ho to catch a “double click” mouse event in SDL?
|
| thanx
I don’t think it is possible to detect a double click EVENT (i.e. issued
by the OS/Windowing system, with system global interval etc.)
What you can do, as described by the others, is to determine double
clicks from the raw mouse events yourself.
However, this is still not a proper double click event, so you should
ideally make the interval user-configurable, and possibly include some
conditionally compiled OS-specific code to get system-wide settings.
Chris E.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFA3pKgRgD2xPOqY+URAkmcAJ9n2AGkosTg/60LzGPezxxPmgvGXACgy2Sh
9UoShJfwqK9aJZdU5pU6gIA=
=Kwkm
-----END PGP SIGNATURE-----