Phantom Documentation

[Help Home] [Phantom Home]


Applicable Classes: MainWin

string sKeys - A formatted string containing the keystrokes to send to the window.
Return Value: None

TypeKeys sends key messages to a window as if a manual keyboard input occurred.  Care must be taken to use the function with the window that actually processes the keyboard input.

The text in sKeys can be formatted to allow for multiple keys to be pressed simultaneously.  Special keys can also be used in TypeKeys.  A list and description of these formats and special keys is as follows:

Regular Characters - Regular characters are input by simply placing them in quotes like a regular string.  All characters in the quotes are sent to the window in the order they are in placed in the quotes.

Special Characters - Special characters are input by placing the character name in open and close arrows ('<' and '>').  A list of Special character names are as follows:


 ESC - The Escape Key  
 BKSP - The Backspace Key  
 PRISC - The Print Screen Key
 CAPS   - The Caps Lock Key
 NUM   - The Num Lock Key
 UP    - The Up arrow Key  
 LEFT   - The Left arrow Key
 RIGHT - The Right arrow Key
 DOWN - The Down arrow Key
 LWIN    - The left Windows Key
 RWIN   - The right Windows Key     
 APPS  - The Application Key

Also, keys can be combined by adding a '-' between the characters within the carats. This is used when two or more characters are to be held down at the same time.

Example Code

#Start notepad and create window variables
window Notepad = MainWin("*", "Notepad");
window Edit = MainWin("*", "Notepad").MainWin(1, "Edit");

# Enter some text in notepad
Edit.TypeKeys("<ENTER><SHIFT-s>ome more text");

# Clear the text so notepad can exit

# Exits Notepad

See Also: MainWin Functions

Copyright 2000-2011 Phantom Automated Solutions