-
[RESOLVED] Sendkeys?
I wish to send a keystroke to an application, but the problem I have is that, I wish the application to simulate the keyboard even more, by adding a delay between the KeyDown and KeyUp events while it sends the keystroke, is this possible in vb.net? (Don't ask me for a code, I don't have any, that's why I ask for help.)
Found a solution:
http://www.pinvoke.net/default.aspx/user32.keybd_event
-
Re: [RESOLVED] Sendkeys?
The solution is the same thing that I was going to suggest: Threading.Thread.Sleep. There is no need to use keybd_event in this case, just use SendKeys:
Code:
Private Sub MimicTyping(ByVal keys() As String)
For Each keystroke As String In keys
'Send the key
SendKeys.Send(keystroke)
'Zzz
Threading.Thread.Sleep(150)
Next
End Sub