Is this possible?
I want
::imo::In my opinion,
To function if enter was the last button pressed. (excluding when imo was typed)
Or else I want
::imo::in my opinion.
To function.
So how would you go about doing this? The if enter was pressed part? Can you give me an example script for that I appreciate it thanks.
I'm guessing it will need a loop to check if enter was pressed, and something that would wait for more than three characters to be typed?
Conditional hotstring? Topic is solved
Conditional hotstring?
I am your average ahk newbie. Just.. a tat more cute.
Re: Conditional hotstring?
Code: Select all
:X:imo::sendinput % "in my opinion" . (a_endchar == "`n" ? "," : ".")
Re: Conditional hotstring?
Someone can explain me why this does not work
it writes
it writes
Code: Select all
:X:imo::sendinput % "in my opinion" . (a_endchar == "`n" ? "," : ".")
... while this workssendinput % "in my opinion" . (a_endchar == "
" ? "," : ".")
Code: Select all
:X:imo::
sendinput % "in my opinion" . (a_endchar == "`n" ? "," : ".")
return
in my opinion. ; with any key
in my opinion, ; with enter
____________________________________________________________________________
Windows 10 Pro 64 bit - Autohotkey v1.1.30.01 64-bit Unicode
Windows 10 Pro 64 bit - Autohotkey v1.1.30.01 64-bit Unicode
Re: Conditional hotstring?
Update . X option is new.your signature wrote:Autohotkey v1.1.24.02 64-bit Unicode
Re: Conditional hotstring?
@Helgef THX.
____________________________________________________________________________
Windows 10 Pro 64 bit - Autohotkey v1.1.30.01 64-bit Unicode
Windows 10 Pro 64 bit - Autohotkey v1.1.30.01 64-bit Unicode
Re: Conditional hotstring?
Woah thanks a lot that's really useful.Helgef wrote:CheersCode: Select all
:X:imo::sendinput % "in my opinion" . (a_endchar == "`n" ? "," : ".")
However that is not what I meant. In your script, it sends out ',' or '.' depending on which end character was used to trigger the hotstring.
But what I want, is if the {enter} button was pressed right before the hotstring is typed, that it says In my opinion, instead of in my opinion. Also notice that there is an uppercase. Is this possible?
I am your average ahk newbie. Just.. a tat more cute.
Re: Conditional hotstring? Topic is solved
Perhaps something like this:
The C option can be helpful for specifying the case of the trigger, and SendInput can be helpful for specifying the case of the output string.
Code: Select all
:B0C:`nImo::
SendInput, {Backspace 3}n my opinion,
return
::imo::in my opinion.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Re: Conditional hotstring?
Thanks I totally forgot about `n!!! You're an angel! This made it so much less complex.jeeswg wrote:Perhaps something like this:The C option can be helpful for specifying the case of the trigger, and SendInput can be helpful for specifying the case of the output string.Code: Select all
:B0C:`nImo:: SendInput, {Backspace 3}n my opinion, return ::imo::in my opinion.
Do you have list for other keys like tab and shift?
I am your average ahk newbie. Just.. a tat more cute.
Re: Conditional hotstring?
These are rather different things, `n is not a key. Here you can find escape sequences: https://autohotkey.com/docs/commands/_EscapeChar.htm Hotkey modifiers like 'shift' on the other hand: https://autohotkey.com/docs/Hotkeys.htm#SymbolsNwb wrote:Do you have list for other keys like tab and shift?
Re: Conditional hotstring?
Thanks precisely what I wanted!gregster wrote:These are rather different things, `n is not a key. Here you can find escape sequences: https://autohotkey.com/docs/commands/_EscapeChar.htm Hotkey modifiers like 'shift' on the other hand: https://autohotkey.com/docs/Hotkeys.htm#SymbolsNwb wrote:Do you have list for other keys like tab and shift?
I am your average ahk newbie. Just.. a tat more cute.
Re: Conditional hotstring?
- Not every key can be used as a hotstring, for tab you can use `t. For shift, sometimes you can specify the key that you would get when you hold down shift, shift+a -> A, shift+1 -> !.
- I did make a suggestion that AutoHotkey could add support for all keys within hotstrings (classic 'easier said than done'), workarounds would be to use the Input command, or to add ~ (tilde) hotkeys for every key, that reset A_PriorKey (and check the value of A_PriorKey within the code for the hotstring).
Code: Select all
:*:!abc::def
:*:`tabc::ghi
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Who is online
Users browsing this forum: MSN [Bot], NinjoOnline and 211 guests