Hello guys!
I need help to make a script with switch function in one key and hold function.
My ideia is to do a switch between the keys "V" and "X", keeping these keys pressed each time i switch.
Ex. If i press "=" once, it will activate and hold the key "V". If i press "=" again, it will release the "V" and will to start to hold the "X" key.
Keeping this cycle hold-release every time i press "=".
Switch + hold key Topic is solved
Re: Switch + hold key Topic is solved
Hallo,
try:
try:
Code: Select all
=::Send,% GetKeyState("x")?"{x Up}{v Down}":"{v Up}{x Down}"
-
- Posts: 14
- Joined: 09 Nov 2015, 18:31
Re: Switch + hold key
@Rohwedder
Great job! It works very well.
It's possible to make another key with a function of stop the switch?
And, as a last favor, it would be possible to create another command in which the "X" and "V" keys are released and the "Space" key is pressed while holding the "[' key?
E.x.:
[ {down}:: X,V {up} Space {down}
[ {up}:: X,V {up} Space {up}
Great job! It works very well.
It's possible to make another key with a function of stop the switch?
And, as a last favor, it would be possible to create another command in which the "X" and "V" keys are released and the "Space" key is pressed while holding the "[' key?
E.x.:
[ {down}:: X,V {up} Space {down}
[ {up}:: X,V {up} Space {up}
Re: Switch + hold key
Then:
Key Q toggles the xv-switch off/on.
Code: Select all
=::Send,% !Switch?(GetKeyState("x")?"{x Up}{v Down}":"{v Up}{x Down}"):"{x Up}{v Up}"
q Up::Send,% (Switch:=!Switch)?"{x Up}{v Up}":""
[::
Send, {x Up}{v Up}{Space Down}
KeyWait, [
Send, {Space Up}
Return
-
- Posts: 14
- Joined: 09 Nov 2015, 18:31
Re: Switch + hold key
@Rohwedder
all works great!
It has just one problem: the space key is sending only once when I hold "["
all works great!
It has just one problem: the space key is sending only once when I hold "["
Re: Switch + hold key
Then with simulated auto repeat:
Code: Select all
=::Send,% !Switch?(GetKeyState("x")?"{x Up}{v Down}":"{v Up}{x Down}"):"{x Up}{v Up}"
q Up::Send,% (Switch:=!Switch)?"{x Up}{v Up}":""
[::
Send, {x Up}{v Up}
While, GetKeyState("[","P")
{
Send, {Space Down}
Sleep, 30
}
Send, {Space Up}
Return