Click to See Complete Forum and Search --> : Detect shift+left mouse click


Starcraft
February 4th, 2000, 12:02 AM
how would I detect if any shift button and the left mouse button has been clicked anywhere on the desktop?

AndyK
February 4th, 2000, 12:34 AM
Here is the code to detect right, left mouse clicks and Shift

private Declare Function GetAsyncKeyState Lib "user32" (byval vKey as Long) as Integer
private Const VK_LBUTTON = &H1
private Const VK_RBUTTON = &H2
private Const VK_SHIFT = &H10


private Sub Form_Load()
Timer1.Interval = 100
End Sub

private Sub Timer1_Timer()
If GetAsyncKeyState(VK_LBUTTON) then Caption = "left"
If GetAsyncKeyState(VK_RBUTTON) then Caption = "right"
If GetAsyncKeyState(VK_SHIFT) then Caption = "shift"
End Sub



Just paste it into clear form