Toggle := 1
F::Send, % Toggle = 1 ? ( "3", Toggle := 0 ) : ( "4", Toggle := 1 )
how do i add a keywait to this
also is it possible to make it work while holding down shift key?, it seems to stop working while holding down shift.
switching keys Topic is solved
-
- Posts: 7
- Joined: 07 Jan 2018, 17:47
Re: switching keys
Change F:: to *f::, which will allow any modifier key to be held down while the f key is pressed. If you want only specifically shift to be allowed, that can be accomplished like this:
What do you mean by add a keywait to this? What are you trying to accomplish? You don't want the send to take place until the f key is released? You can add up to the hotkey name to have it wait until it is released: f up::
Code: Select all
f::
+f::
Send, % Toggle = 1 ? ( "3", Toggle := 0 ) : ( "4", Toggle := 1 )
return
-
- Posts: 7
- Joined: 07 Jan 2018, 17:47
Re: switching keys
boiler wrote:Change F:: to *f::, which will allow any modifier key to be held down while the f key is pressed. If you want only specifically shift to be allowed, that can be accomplished like this:What do you mean by add a keywait to this? What are you trying to accomplish? You don't want the send to take place until the f key is released? You can add up to the hotkey name to have it wait until it is released: f up::Code: Select all
f:: +f:: Send, % Toggle = 1 ? ( "3", Toggle := 0 ) : ( "4", Toggle := 1 ) return
that worked a treat, i want a keywait so when i hold down F it doesn't switch between the two numbers, infinitely.
i'd rather have to press F each time for it to switch, if i have my finger held down on the F key i don't want to rotate between 3-4 until my finger has lifted off the F key
Re: switching keys Topic is solved
So you changed each to f up:: and +f up:: and it's doing what you want now, right?
-
- Posts: 7
- Joined: 07 Jan 2018, 17:47
Re: switching keys
perfect!.boiler wrote:So you changed each to f up:: and +f up:: and it's doing what you want now, right?
-
- Posts: 7
- Joined: 07 Jan 2018, 17:47
Re: switching keys
is it possible to do 2-3-4, instead of just twoboiler wrote:So you changed each to f up:: and +f up:: and it's doing what you want now, right?
Re: switching keys
Yes. You just need to nest the ternary if statement.
Code: Select all
Toggle := 1
f::
+f::
Send, % Toggle = 1 ? ( "2", Toggle := 2 ) : ( Toggle = 2 ? ( "3", Toggle := 3 ) : ( "4", Toggle := 1 ) )
return
-
- Posts: 7
- Joined: 07 Jan 2018, 17:47
Re: switching keys
that worked well,boiler wrote:Yes. You just need to nest the ternary if statement.
Code: Select all
Toggle := 1 f:: +f:: Send, % Toggle = 1 ? ( "2", Toggle := 2 ) : ( Toggle = 2 ? ( "3", Toggle := 3 ) : ( "4", Toggle := 1 ) ) return
*f up::
+f up::
Send, % Toggle = 1 ? ( "3", Toggle := 0 ) : ( "4", Toggle := 1 )
return
i wanna make this^ script reset back to (3) when i press any of the following keys (c) (v) (2) (1)
also whats your paypal address all the help you've given me i feel it's only right to chuck you at least $5-10
thanks - qwerty2002.
Re: switching keys
I assume you mean you press c, v, or 2, and it resets but doesn't send anything. It's just ready to send 3 again the next time you press f. You also don't need the second line in the script you showed (+f up::). That is already covered by putting the * on the first line (which also allows it to be a single-line hotkey definition).
Thanks for the offer, but don't worry about it. Glad to help.
Code: Select all
*f up::Send, % Toggle = 1 ? ( "3", Toggle := 0 ) : ( "4", Toggle := 1 )
c::
v::
2::
Toggle := 1
return
-
- Posts: 7
- Joined: 07 Jan 2018, 17:47
Re: switching keys
are you sure?, no i also want those keys active, but i simply want to reset it.boiler wrote:I assume you mean you press c, v, or 2, and it resets but doesn't send anything. It's just ready to send 3 again the next time you press f. You also don't need the second line in the script you showed (+f up::). That is already covered by putting the * on the first line (which also allows it to be a single-line hotkey definition).
Thanks for the offer, but don't worry about it. Glad to help.Code: Select all
*f up::Send, % Toggle = 1 ? ( "3", Toggle := 0 ) : ( "4", Toggle := 1 ) c:: v:: 2:: Toggle := 1 return
Re: switching keys
If you want c, v, and 2 to still do their normal function, then just put a ~ in front of them.
-
- Posts: 7
- Joined: 07 Jan 2018, 17:47
Re: switching keys
its really strange sometimes during the script running it will randomly start entering #4 after pressing the *2* *c* or *v*boiler wrote:If you want c, v, and 2 to still do their normal function, then just put a ~ in front of them.