|
-
Oct 5th, 2008, 01:59 AM
#1
Thread Starter
Addicted Member
keybd_event Left Mouse Button Constant?
What is the keybd constand for the left mouse button?
All the documentation I have been able to find says its 0x01 wich should be &H1 right? Yet, it dosen't seem correct.
And while im at it:
I have a multi button mouse (4 normal buttons and then a scroll weel that has 3 more in it). What are the keybd constants for those?
Code:
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, _
ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Const MYKEYEVENTF_KEYUP = &H2
Private Const MYVK_LBUTTON = &H1
''''''''''''''''''''''''''''''''''''''''''''''
keybd_event MYVK_LBUTTON, 0, 0, 0
Sleep 500
keybd_event MYVK_LBUTTON, 0, MYKEYEVENTF_KEYUP, 0
(yes, I have looked around quite a bit. Seems one of the hardest things for me to find a 100% complete and correct source on....)
-
Oct 5th, 2008, 02:45 AM
#2
Re: keybd_event Left Mouse Button Constant?
-
Oct 5th, 2008, 11:03 AM
#3
Thread Starter
Addicted Member
Re: keybd_event Left Mouse Button Constant?
That is the page I've been useing
VK_LBUTTON (0x01)
Left mouse button
Private Const MYVK_LBUTTON = &H1 Dosent seem to be correct.
-
Oct 5th, 2008, 11:40 AM
#4
Re: keybd_event Left Mouse Button Constant?
You should use the mouse_event function instead of the keybd_event function for mouse handling routines.
-
Oct 5th, 2008, 11:56 AM
#5
Thread Starter
Addicted Member
Re: keybd_event Left Mouse Button Constant?
-
Oct 5th, 2008, 01:02 PM
#6
Re: keybd_event Left Mouse Button Constant?
 Originally Posted by Tontow
Got a link?
Yes I have, since I know how to do a Google search 
http://allapi.mentalis.org/apilist/mouse_event.shtml
-
Oct 5th, 2008, 02:32 PM
#7
Thread Starter
Addicted Member
Re: keybd_event Left Mouse Button Constant?
Is it better to use mouse_event or SetCursorPos to move the mouse?
Code:
Private Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long
-
Oct 5th, 2008, 02:54 PM
#8
Re: keybd_event Left Mouse Button Constant?
It doesn't really matter. If all you want to do is to move te cursor then using SetCursorPos is a bit easier to call. However mouse_event can do so much more.
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
|