Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Tue Jul 20, 2004 4:20 pm Post subject: |
|
|
Not with hotstrings, but you can use the Input command to do something very similar to hotstrings (and it accepts keys such as CTRL as end characters): http://www.autohotkey.com/docs/commands/Input.htm
Here is an example I modified from the help file:
| Code: | ~[::
Input, UserInput, V T5 L4 C, {enter}.{rcontrol}{esc}{tab}, btw,otoh,fl,ahk,ca
if ErrorLevel = Max
{
MsgBox, You entered "%UserInput%", which is the maximum length of text.
return
}
if ErrorLevel = Timeout
{
MsgBox, You entered "%UserInput%" at which time the input timed out.
return
}
if ErrorLevel = NewInput
return
IfInString, ErrorLevel, EndKey:
{
MsgBox, You entered "%UserInput%" and terminated the input with %ErrorLevel%.
return
}
; Otherwise, a match was found.
SetKeyDelay, -1 ; Most editors can handle the fastest speed.
if UserInput = btw
Send, {backspace 4}by the way
else if UserInput = otoh
Send, {backspace 5}on the other hand
else if UserInput = fl
Send, {backspace 3}Florida
else if UserInput = ca
Send, {backspace 3}California
else if UserInput = ahk
Run, www.autohotkey.com
return |
|
|