Sendkeys

How to automate key strokes. This can be used in a loop or with a timer, allowing automation even without the user having to input something.

Author: ferrari12508
Category: VB.NET

Instructions:
This can be used for anything really
The first line sends the letter A, the second send the F5 key. The + sign when not in brackets acts as the shift key. the ^ key acts as ctrl when not in brackets and the % sign works as alt when not in brackets. Special keys such as Enter and page down are represented in lines 3-4 and is how other keys of this type work.

Code:
  1. [code]
  2. sendkeys.send("a")
  3. sendkeys.send("{F5}")
  4. sendkeys.send("{ENTER}")
  5. sendkeys.send("{PGDN}")
  6. [/code]

Copy to IDE: (Highlight)
[code]
sendkeys.send("a")
sendkeys.send("{F5}")
sendkeys.send("{ENTER}")
sendkeys.send("{PGDN}")
[/code]

Highlighting: None
Date: December 29, 2009, 07:01:15 PM
Views: 454


(Please Register or Log In to comment)
TheCodeCube - IT Community | Snippets System - Copyright (c) FoxSoft