|
-
Mar 11th, 2001, 02:59 PM
#1
Thread Starter
Junior Member
How do I determine if the user pressed both the left and right mouse buttons at the same time?
The catch is that I want to know this information from the MouseDown event, not the MouseMove event.
MouseDown - Button = the button which caused the event
MouseMove - Button = collective state of pressed buttons
It's the latter Button state that I want, but I do not want to have to use the MouseMove event?
Any ideas?
-
Mar 11th, 2001, 03:14 PM
#2
Frenzied Member
i dont know the code but all u have to do is make it so when you press the eft it checks the right and if the right is down then execute code if not then do else.
- JayWare
Live to love. Not to Hate
Im to busy to have a site. But I got one and still working on it.
http://dre3k.net/
-
Mar 11th, 2001, 04:00 PM
#3
Thread Starter
Junior Member
Hmmm
...but that won't work will it?
In the MouseDown event Button = vbLeft or vbRightButton, so it can't be both?
-
Mar 11th, 2001, 04:13 PM
#4
Hyperactive Member
Originally posted by redbird77
How do I determine if the user pressed both the left and right mouse buttons at the same time?
The catch is that I want to know this information from the MouseDown event, not the MouseMove event.
MouseDown - Button = the button which caused the event
MouseMove - Button = collective state of pressed buttons
It's the latter Button state that I want, but I do not want to have to use the MouseMove event?
Any ideas?
Try this
Button = vbLeftButton + vbRightButton
-
Mar 11th, 2001, 04:51 PM
#5
Thread Starter
Junior Member
I've tried vbLeftButton + vbRightButton (which = 3).
But I think that only works in the MouseMove event. In the MouseDown event I'm only seeing Button as equal to 1 or 2.
-
Mar 11th, 2001, 05:09 PM
#6
Surly you can only catch one button, unless you are realy good at pressing both at the same time.
This catches to button presses
(code)
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
MsgBox "Left"
End If
If Button = 2 Then
MsgBox "Right"
End If
End Sub
(\code)
-
Mar 11th, 2001, 05:20 PM
#7
Hyperactive Member
Originally posted by redbird77
I've tried vbLeftButton + vbRightButton (which = 3).
But I think that only works in the MouseMove event. In the MouseDown event I'm only seeing Button as equal to 1 or 2.
Yes, it SHOULD work, I did that before. MouseDown/KeyDown Event is use to capture the number of buttons/keys pressed at a time.
You can try doing this
Select case Button
Case vbLeftButton
frmOut.txtButton.Text = "Left"
Case vbRightButton
frmOut.txtButton.Text = "Right"
Case vbMiddleButton
frmOut.txtButton.Text = "Middle"
Case vbLeftButton + vbRightButton
frmOut.txtButton.Text = "L+R"
Case vbLeftButton + vbMiddleButton
frmOut.txtButton.Text = "L+M"
Case vbMiddleButton + vbRightButton
frmOut.txtButton.Text = "M+R"
End Select
Well, of course you gotta create the textbox named txtButton on a form named frmOut
Good Luck!
Harddisk
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
|