| View previous topic :: View next topic |
| Author |
Message |
xmav000
Joined: 15 Jun 2008 Posts: 10
|
Posted: Fri Jun 27, 2008 5:40 pm Post subject: extending hotstrings? |
|
|
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 |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 6066
|
Posted: Fri Jun 27, 2008 7:24 pm Post subject: |
|
|
Is this a tip or is there a question ?  _________________
 |
|
| Back to top |
|
 |
Razlin
Joined: 05 Nov 2007 Posts: 395 Location: canada
|
Posted: Fri Jun 27, 2008 8:27 pm Post subject: |
|
|
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 |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 6066
|
Posted: Fri Jun 27, 2008 8:38 pm Post subject: |
|
|
| Code: | :*?C:r20::
if (composeActive) {
send xx
composeActive := 0
} else {
Send r20
}
Return |
 _________________
 |
|
| Back to top |
|
 |
xmav000
Joined: 15 Jun 2008 Posts: 10
|
Posted: Fri Jun 27, 2008 9:04 pm Post subject: |
|
|
Hmm I thought the problem was clear.
r20 will fire before r200 so r200 will not work at all. Clear now? |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 6066
|
Posted: Fri Jun 27, 2008 9:26 pm Post subject: |
|
|
| xmav000 wrote: | | Clear now? |
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.  _________________
 |
|
| Back to top |
|
 |
xmav000
Joined: 15 Jun 2008 Posts: 10
|
Posted: Sat Jun 28, 2008 11:53 pm Post subject: |
|
|
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?  |
|
| Back to top |
|
 |
ahklerner
Joined: 26 Jun 2006 Posts: 1219 Location: USA
|
Posted: Mon Jun 30, 2008 9:36 pm Post subject: |
|
|
you need titans regex hotstrings _________________
 |
|
| Back to top |
|
 |
|