Advertisement

mouse event

Started by August 24, 2001 03:08 AM
2 comments, last by Kosov 23 years, 5 months ago
I''m searching for a windows function which indicate when a mouse button is down and which of the button is down. I ve tried "GetQueueStatus()" but it only indicates when an event append but not what type of event it is. thx
You can use GetAsyncKeyState() for that, for the first moust button for example you would do: GetAsyncKeyState(VK_LBUTTON);


- Goblineye Entertainment
The road to success is always under construction

Edited by - Tornado on August 24, 2001 6:39:13 PM
Goblineye EntertainmentThe road to success is always under construction
Advertisement
Yes but the problem is that i don t know when the key is down or up, so when i push a button it stay pushed until i push again the mouse button.
If it was possible to put VK_LBUTTONDOWN it''ll be great but ...
You can test the bits in the value returned by GetAsyncKeyState() to see whether the key/button is pressed or released. IIRC the most significant bit gives the pressed-status of the key, so:
      #define KEY_PRESSED(key) ((GetAsyncKeyState(key) & 0x8000) == 0x8000)  #define KEY_RELEASED(key) ((GetAsyncKeyState(key) & 0x8000) == 0)      

(If it doesn't work, check the docs to see which bit it should be)

Edited by - Dactylos on August 25, 2001 7:11:47 AM

This topic is closed to new replies.

Advertisement