AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Endchars

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
wolive



Joined: 20 Jul 2004
Posts: 21
Location: South Africa

PostPosted: Tue Jul 20, 2004 3:55 pm    Post subject: Endchars Reply with quote

I would like to use the Right Control key as an EndChar in the same way that `t corresponds to tab. Is this at all possible.

Thanks in advance
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10467

PostPosted: Tue Jul 20, 2004 4:20 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group