Difference between revisions of "How to press a key using an alias"
From Scriptwiki
m (changed link) |
|||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
With this alias, you are able to "send keys" to the active window, which doesnt have to be mIRC. | 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 | + | For descriptions of all the keys, see: http://msdn.microsoft.com/en-us/library/8c6yea83.aspx |
− | You will have to paste this script into the ' | + | You will have to paste this script into the 'Remote' section of mIRC's script editor. |
alias sendkey { | alias sendkey { | ||
− | set -l %name sendkeys $+ $ticks | + | [[set]] -l %name sendkeys $+ [[$ticks]] |
− | .comopen %name WScript.Shell | + | .[[comopen]] %name WScript.Shell |
− | .comclose %name $com(%name,SendKeys,3,bstr,$1-) | + | .[[comclose]] %name [[$com]](%name,SendKeys,3,bstr,[[$1-]]) |
} | } | ||
== Example == | == Example == | ||
− | + | sendkey {TAB} | |
− | This sends the | + | This sends the "Tab"-Key to the active window (using the alias specified above). It is the same as if you'd press the "Tab"-Key on your keyboard. |
− | [[Category: | + | |
+ | sendkey +(ab)c | ||
+ | This would send "ABc" to the active window, as +(ab) means 'shift' and 'a' and 'b' and a lone 'c' after that. | ||
+ | |||
+ | [[Category:Script Archive]] |
Latest revision as of 16:42, 8 September 2008
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/en-us/library/8c6yea83.aspx
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 {TAB}
This sends the "Tab"-Key to the active window (using the alias specified above). It is the same as if you'd press the "Tab"-Key on your keyboard.
sendkey +(ab)c
This would send "ABc" to the active window, as +(ab) means 'shift' and 'a' and 'b' and a lone 'c' after that.