Small issue with my AutoRun Script Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
wyw
Posts: 93
Joined: 12 Dec 2015, 19:11

Small issue with my AutoRun Script

07 Nov 2019, 05:10

Hey everyone.


I'm afraid I have a little problem with my script.

Code: Select all

~$w::
send,{LShift Down}
keywait,w
Send,{LShift Up}
return
~$XButton2::
send,{LShift Down}
send,{w Down}
return
~$f7::ExitApp


This is my AutoRun script. Whenever I hold the key "w" down, it holds "LShift" down. So far so good. That works fine.


When I press the "XButton2", it will send "w" down and "LShift" down, allowing me to run continuously without pressing or holding any key. That works fine too.

As soon as I press "w", it will stop me from auto running as intended. But if I press the "XButton2" again, I cannot perform the same action. The only way to get it working is to press "LShift" manually, then it triggers the function for some reason.



I'd appreciate it if someone would help me with this. Before I ask for help, I try to solve the problems myself. I worked on it for a few hours yesterday, but I just couldn't find the cause. :crazy:
Rohwedder
Posts: 7645
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Small issue with my AutoRun Script  Topic is solved

07 Nov 2019, 07:25

Hallo,
perhaps:

Code: Select all

~*w::
send,{LShift Down}
keywait,w
Send,{LShift Up}
return
~XButton2::send,{LShift Down}{w Down}
~$f7::ExitApp
wyw
Posts: 93
Joined: 12 Dec 2015, 19:11

Re: Small issue with my AutoRun Script

07 Nov 2019, 08:43

Rohwedder wrote:
07 Nov 2019, 07:25
Hallo,
perhaps:

Code: Select all

~*w::
send,{LShift Down}
keywait,w
Send,{LShift Up}
return
~XButton2::send,{LShift Down}{w Down}
~$f7::ExitApp

Thank you very much Rohwedder! Works very well. :D

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 353 guests