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 

extending hotstrings?

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



Joined: 15 Jun 2008
Posts: 10

PostPosted: Fri Jun 27, 2008 5:40 pm    Post subject: extending hotstrings? Reply with quote

We have a "compose" key which is triggered by caps+tab (will set composeActive := 1).
when compose is activated r20 should transform to xx, r200 to cc and r200 0 to mm. It works if we do it like the following.
Code:

:*O?C:r20`n::
  if (composeActive) {
     send xx
     composeActive := 0
  } else {
     send r20
  }
Return

:*O?C:r200`n::
  if (composeActive) {
     sendraw cc
     composeActive := 0
  } else {
     send r200
  }
Return

:*O?C:r2000::
  if (composeActive) {
     send mm
     composeActive := 0
  } else {
     send r2000
  }
Return

But only because we use enter as end char.
We would like to not need any end char.

With space the compActive is set back to 0.

How can we do this without any end char?

I think this might be a tricky one.
ciao
xmav000

Edit: Made the question obvious


Last edited by xmav000 on Fri Jun 27, 2008 7:40 pm; edited 1 time in total
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 6066

PostPosted: Fri Jun 27, 2008 7:24 pm    Post subject: Reply with quote

Is this a tip or is there a question ? Rolling Eyes
_________________
Back to top
View user's profile Send private message
Razlin



Joined: 05 Nov 2007
Posts: 395
Location: canada

PostPosted: Fri Jun 27, 2008 8:27 pm    Post subject: Reply with quote

why dont you just remove the `n from your hotstrings

Code:
:*O?C:r20::
msgbox hello
return


What code have you tryed that didnt work?
_________________
-=Raz=-
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 6066

PostPosted: Fri Jun 27, 2008 8:38 pm    Post subject: Reply with quote

Code:
:*?C:r20::
  if (composeActive) {
     send xx
     composeActive := 0
  } else {
     Send r20
  }
Return


Question Rolling Eyes
_________________
Back to top
View user's profile Send private message
xmav000



Joined: 15 Jun 2008
Posts: 10

PostPosted: Fri Jun 27, 2008 9:04 pm    Post subject: Reply with quote

Hmm I thought the problem was clear.

r20 will fire before r200 so r200 will not work at all. Clear now?
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 6066

PostPosted: Fri Jun 27, 2008 9:26 pm    Post subject: Reply with quote

xmav000 wrote:
Clear now?


Very Happy It is .. I did not read past the first hotstring..

you need to merge them all into a single hotstring.
refer AHK doc for input command:

Code:
::r2::
  Loop {
   input,,,,
   ; test the number of zeroes entered
  }

....
Return


Would be pretty complicated. Very Happy
_________________
Back to top
View user's profile Send private message
xmav000



Joined: 15 Jun 2008
Posts: 10

PostPosted: Sat Jun 28, 2008 11:53 pm    Post subject: Reply with quote

would be nice if it would work similar to the following
Code:

:*O?:r20::xx
:*O?:xx0::cc

so that if i typl r200 it first changes to xx and takes the xx also as input and triggers the second hotstring if 0 is the next input.
could i use some other kind of send method for this to work? I heard some expert saying this should already work, but I tried and it didn't. so what's wrong? Smile
Back to top
View user's profile Send private message
ahklerner



Joined: 26 Jun 2006
Posts: 1219
Location: USA

PostPosted: Mon Jun 30, 2008 9:36 pm    Post subject: Reply with quote

you need titans regex hotstrings
_________________
Back to top
View user's profile Send private message
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