Difference between revisions of "How to press a key using an alias"

From Scriptwiki
Jump to: navigation, search
m (typo)
Line 2: Line 2:
 
For descriptions of all the keys, see: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/wsmthsendkeys.asp
 
For descriptions of all the keys, see: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/wsmthsendkeys.asp
  
You will have to paste this script into the 'Aliases' section of mIRC's script editor.
+
You will have to paste this script into the 'Remote' section of mIRC's script editor.
  
 
  alias sendkey {
 
  alias sendkey {
Line 14: Line 14:
 
  /sendkey {F1}
 
  /sendkey {F1}
  
This sends the F1-Key to the active window.
+
This sends the F1-Key to the active window (using the alias specified above).
  
 
[[Category:Snippets]]
 
[[Category:Snippets]]

Revision as of 18:24, 22 November 2005

With this alias, you are able to "send keys" to the active window, which doesnt have to be mIRC. For descriptions of all the keys, see: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/wsmthsendkeys.asp

You will have to paste this script into the 'Remote' section of mIRC's script editor.

alias sendkey {
 set -l %name sendkeys $+ $ticks
 .comopen %name WScript.Shell
 .comclose %name $com(%name,SendKeys,3,bstr,$1-)
}

Example

/sendkey {F1}

This sends the F1-Key to the active window (using the alias specified above).