hi
How can I control from the keyboard letter pressing a specific place on the screen like mouse Cursor.Position
I tried to use this code, but the mouse pointer is moving and the button is not pressed within this specific space, the letter D
How can I control from the keyboard letter pressing a specific place on the screen like mouse Cursor.Position
Code:
Private Const KEYEVENTF_KEYDOWN As Integer = &H0
Private Const KEYEVENTF_KEYUP As Integer = &H2
<DllImport("user32.dll", EntryPoint:="keybd_event")>
Private Shared Sub keybd_event(ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As UInteger, ByVal dwExtraInfo As UInteger)
End Sub
Private Sub Timer3_Tick(sender As Object, e As EventArgs) Handles Timer3.Tick
Cursor.Position = New Point(1006, 360)
keybd_event(CByte(Keys.D), 0, KEYEVENTF_KEYDOWN, 0)
keybd_event(CByte(Keys.D), 0, KEYEVENTF_KEYUP, 0)
End Sub