|
-
December 8th, 1999, 09:48 PM
#1
Mouse Buttons
All,
Is there an API call for what mouse buttons are down and which ones are up? I know there is mousedown events in Visual Basic, but I don't want to make an event for everything if my program. I need to know if the left mouse button is down and if the right mouse buttons is down or both. Can somebody please help me?
Xemion
-
December 9th, 1999, 10:27 AM
#2
Re: Mouse Buttons
You can use API Function GetAsyncKeyState(), with
VK_LBUTTON for left mouse button,
VK_RBUTTON for right mouse button
and VK_MBUTTON for middle mouse button,
which will give you the mouse status (which key pressed or released).
You can also check in Key_Down and Key_Up Events for
vbKeyLButton, vbKeyRButton and bvKeyMButton constants, so you don't need API.
Good Luck!
-
December 9th, 1999, 02:38 PM
#3
-
December 10th, 1999, 09:34 AM
#4
Re: Mouse Buttons
Ruth,
I have another question. Sometimes GetAynscKeyState isn't picking up my mouse clicks. I've got it check for clicks in a do loop,
sometimes is misses clicks. Would this be because the mouse button is down while it's checking for clicks? I don't understand why it's skipping them. Can you help?
Xemion
-
December 12th, 1999, 02:09 AM
#5
Re: Mouse Buttons
It could depend on the speed of your Mouse Driver and on the speed of your Loop.
If you check the Mouse Status slower than it changes it you could miss something.
It also depend on the priority of your application, and, of course, on the Operating
System. To be sure that everything is OK, try to remember that
GetAsyncKeyState returns you 0 if mouse or key didn't pressed, 80 if it was pressed
once, 81 if it was pressed continuously and 1 if it was pressed and released.
Good Luck
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|