D
Daniel N
Is there a way to hold down keys in vb.net?
In the program I am writing I can simulate a MOUSE button hold down:
Public Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx
As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As
Long)
Public Const MOUSEEVENTF_LEFTDOWN As Object = &H2
Public Const MOUSEEVENTF_LEFTUP As Object = &H4
Public Sub LeftDown()
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
End Sub
Public Sub LeftUp()
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
End Sub
Public Sub LeftClick()
LeftDown()
LeftUp()
End Sub
So I am Sure I can do this with a keyboard key (Specifically ALT, and the
SHIFT keys). Sendkeys does not work (Its much like a click by sending a down
AND an UP). As you can see I googled and found that using the hex &H2 to
simulate a mouse button click worked I am sure there is a way to do it for
the keyboard. Thanks if you can provide help.
In the program I am writing I can simulate a MOUSE button hold down:
Public Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx
As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As
Long)
Public Const MOUSEEVENTF_LEFTDOWN As Object = &H2
Public Const MOUSEEVENTF_LEFTUP As Object = &H4
Public Sub LeftDown()
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
End Sub
Public Sub LeftUp()
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
End Sub
Public Sub LeftClick()
LeftDown()
LeftUp()
End Sub
So I am Sure I can do this with a keyboard key (Specifically ALT, and the
SHIFT keys). Sendkeys does not work (Its much like a click by sending a down
AND an UP). As you can see I googled and found that using the hex &H2 to
simulate a mouse button click worked I am sure there is a way to do it for
the keyboard. Thanks if you can provide help.