-
Oct 13th, 2014, 06:58 AM
#1
Thread Starter
Fanatic Member
[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
Last edited by Justa Lol; Oct 13th, 2014 at 07:35 AM.
-
Oct 13th, 2014, 09:01 AM
#2
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
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
|