View Full Version : Keybord Mapping
Hi All,
Is it possible to write a script, which would allow me to run a program on a press of a specific key....
For Ex:- F1 Key = Windows Help
darkness
01-07-2002, 02:34 PM
here's a copy of the example from the documentation 5.6 scripting giude.
set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "calc"
WScript.Sleep 100
WshShell.AppActivate "Calculator"
WScript.Sleep 100
WshShell.SendKeys "1{+}"
WScript.Sleep 500
WshShell.SendKeys "2"
WScript.Sleep 500
WshShell.SendKeys "~"
WScript.Sleep 500
WshShell.SendKeys "*3"
WScript.Sleep 500
WshShell.SendKeys "~"
WScript.Sleep 2500
Good Luck.
Michael McLaughlin/images/forums/icons/smile.gif
Systems Manager
Minnesota State University Mankato
What is this supposed to do ??????
darkness
01-09-2002, 04:36 PM
set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "calc"
WScript.Sleep 100
WshShell.AppActivate "Calculator"
WScript.Sleep 100
WshShell.SendKeys "1{+}"
WScript.Sleep 500
WshShell.SendKeys "2"
WScript.Sleep 500
WshShell.SendKeys "~"
WScript.Sleep 500
WshShell.SendKeys "*3"
WScript.Sleep 500
WshShell.SendKeys "~"
WScript.Sleep 2500
This Opens Windows Calculator. and the wscript.sleep for 100 milleseconds. And sends strings of keys to the application with delays inbetween. Cut and paste the script into a calculator.vbs file and double click the file on your desktop. This is just an example of opening a application and sending keystrokes to it.
Michael McLaughlin/images/forums/icons/smile.gif
Systems Manager
Minnesota State University Mankato
Powered by vBulletin™ Version 4.1.0 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.