|
win32: detecting double click ? |
A J
Member #3,025
December 2002
|
in windowed mode i can spy on the WM_LBUTTONDOWN mesages and log when they occur, this gives me suffecient timing information to detect double clicks. but in fullscreen mode, WM_LBUTTONDOWN messages dont appear to be sent. i'll consider solutions that involve hacking allegro too.. as i think that is the only way its going to happen. ___________________________ |
piccolo
Member #3,163
January 2003
|
wow |
BAF
Member #2,981
December 2002
|
That isn't very elegant... sleeping multiple times in the poll function. Also, why use show_mouse? Just draw_sprite() mouse_sprite to the x/y. |
piccolo
Member #3,163
January 2003
|
BAF said: That isn't very elegant... sleeping multiple times in the poll function. there were 2 other way i thought up but they involve variables . this the best metod out of the tree. plus this can be class independent. BAF said: Also, why use show_mouse? Just draw_sprite() mouse_sprite to the x/y. i am using the defalt mouse sprite. i did not load my own yet. check out my game and write a review if you can please wow |
A J
Member #3,025
December 2002
|
picollo, you've missed the point, how can i detect the mouse_b is im busy doing other stuff ___________________________ |
GullRaDriel
Member #3,861
September 2003
|
AJ said: how can i detect the mouse_b is im busy doing other stuff héhé use pthread my bad ! "Code is like shit - it only smells if it is not yours" |
piccolo
Member #3,163
January 2003
|
is_doubleclick(); put that any where you want to check. wow |
Arthur Kalliokoski
Second in Command
February 2005
|
This is a windows prog? Check out WM_LBUTTONDBLCLK message. They all watch too much MSNBC... they get ideas. |
BAF
Member #2,981
December 2002
|
What? That was the problem... it wasn't working for him full screen. |
A J
Member #3,025
December 2002
|
in windowed mode, i can see the WM_LBUTTON message, but in fullscreen mode i dont. ___________________________ |
piccolo
Member #3,163
January 2003
|
gezzz thouse sleeps are in Milli seconds I'm using 50 50, and it only activates when the mouse is pressed. wow |
Marco Radaelli
Member #3,028
December 2002
|
A bit offtopic: how do you make a window fullscreen? I think that doesn't mean it's maximized. Maybe that's in some way related to why you're not getting those messages (I suppose you still get WM_CHAR and friends).
|
A J
Member #3,025
December 2002
|
Marco.. i use set_gfx_mode(AUTO_DETECT_FULLSCREEN, piccolo, it can't sleep, its busy doing other work, like rendering graphics. ___________________________ |
Milan Mimica
Member #3,877
September 2003
|
You'll have to took at allegro source code why messages are not forwarded to you app. My wild guess is that it creates another window to handle input.
-- |
Myrdos
Member #1,772
December 2001
|
I'm not familiar with WM_LBUTTONDOWN, but couldn't you use Allegro's interrupt routines? http://www.allegro.cc/manual/api/mouse-routines/mouse_callback You'll need to keep track of the number of MOUSE_FLAG_LEFT_DOWNs you got, with a timer to see if they were sufficiently close together. __________________________________________________ |
|