Usman ur Rehman Ahmed's blog

Make a New World Record using SendKeys

Yesterday, a friend of mine came across an application game (to type a-z in least time http://apps.facebook.com/typea-z) on facebook and it was getting hard for him to manually score better than 5.12 seconds to type all the alphabet keys.

Since he had to win amongst friends, the workaround was simple. I wrote down a simple utility in VB .net to perform clicks using SendKey API. I was able to secure the goal in just 0.03 seconds. I thought to share the code right here.

The point to highlight in this post is, if you would use the send method of the SendKeys class, you will fail miserably, since send method doesn't wait for the message to be processed, however sendWait method makes sure that the keys that are sent are processed by the consumer application.

See if you have a better processing speed than my system to beat this record. :)

Public Class Form1
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim i As Integer = 0
        ''Give a delay so that you can manually click the Facebook browser window to gain focus
        Threading.Thread.Sleep(3000)
        For i = 0 To 5
            SendKeys.SendWait("abcdefghijklmnopqrstuvwxyz")
        Next
    End Sub
End Class

11
To Posterous, Love Metalab