Thank you. It works great.
I appreciate all the help
Search found 12 matches
- 11 Apr 2024, 22:04
- Forum: Ask for Help (v2)
- Topic: Key Hold to Run script question
- Replies: 23
- Views: 445
- 11 Apr 2024, 12:52
- Forum: Ask for Help (v2)
- Topic: Key Hold to Run script question
- Replies: 23
- Views: 445
Re: Key Hold to Run script question
Thank you @boiler for showing how to bind a parameter to a Func Object. (It's included in the AHK documentation, but I never knew how to use it until I could see an actual example, which boiler provided.) @boat_58 I've improved the script by changing ID_of_this_instance from a Global variable to a ...
- 11 Apr 2024, 11:19
- Forum: Ask for Help (v2)
- Topic: Key Hold to Run script question
- Replies: 23
- Views: 445
Re: Key Hold to Run script question
Reload wasn't working for us previously, because our SetTimer delay period was too short (only 20 ms). If multiple instances of the script are started simultaneously, they may fail to detect each other or may all target the same previous instance. This would result in multiple instances of the scri...
- 10 Apr 2024, 15:15
- Forum: Ask for Help (v2)
- Topic: Key Hold to Run script question
- Replies: 23
- Views: 445
- 10 Apr 2024, 13:25
- Forum: Ask for Help (v2)
- Topic: Key Hold to Run script question
- Replies: 23
- Views: 445
Re: Key Hold to Run script question
It may be because you have #SingleInstance Off at the top of your script. Try removing that. I used the below script to test. I removed the SingleInstance from the top and it was still showing multiple instances of the script based on how many times it re-ran while i had the button pushed down. Whe...
- 10 Apr 2024, 12:13
- Forum: Ask for Help (v2)
- Topic: Key Hold to Run script question
- Replies: 23
- Views: 445
Re: Key Hold to Run script question
Is the "Reload" suppose to generate multiple instances of the script when it is restarted from holding the key down long?boiler wrote: ↑10 Apr 2024, 07:55Code: Select all
CheckIfKeyIsHeldDown(key) { If not GetKeyState(key) ;if you let go of the key, then: Reload }
- 10 Apr 2024, 07:49
- Forum: Ask for Help (v2)
- Topic: Key Hold to Run script question
- Replies: 23
- Views: 445
Re: Key Hold to Run script question
I'm not sure, but why are you running a second instance of the sript and killing another instead of just using Reload ? That was the code that was suggested by an earlier user trying to help. Can you show me how using "Reload" instead would look like with the below code that i have for testing? I a...
- 09 Apr 2024, 12:41
- Forum: Ask for Help (v2)
- Topic: Key Hold to Run script question
- Replies: 23
- Views: 445
Re: Key Hold to Run script question
Note that the function CheckIfKeyIsHeldDown also has Numpad8 hardcoded to it, so it would need to be changed there as well. It would be better if it automatically checked the hotkey (assuming it’s not a key combination) by binding it as a parameter like this: SetTimer CheckIfKeyIsHeldDown.Bind(A_Th...
- 09 Apr 2024, 09:46
- Forum: Ask for Help (v2)
- Topic: Key Hold to Run script question
- Replies: 23
- Views: 445
Re: Key Hold to Run script question
My suggestion is using SetTimer and GetKeyState. Here's an example. Save this code in ahk file extension and type the path to the ahk file in the "Path_to_this_ahk_file" variable. When you hold down Numpad8 key, it'll show a Tooltip with a number and count up to 5 while Numpad8 is held down. It sto...
- 09 Apr 2024, 09:32
- Forum: Ask for Help (v2)
- Topic: Key Hold to Run script question
- Replies: 23
- Views: 445
Re: Key Hold to Run script question
@boat_58 — The path to the file needs to include the script file itself, not just the folder in which it resides. Thank you. I forgot to add the .ahk extension. It is now working as intended. Instead of using Numpad8, how can i make it so it uses mouse button 4 or 5? I have tried Xbutton[1-5] just ...
- 09 Apr 2024, 07:42
- Forum: Ask for Help (v2)
- Topic: Key Hold to Run script question
- Replies: 23
- Views: 445
Re: Key Hold to Run script question
My suggestion is using SetTimer and GetKeyState. Here's an example. Save this code in ahk file extension and type the path to the ahk file in the "Path_to_this_ahk_file" variable. When you hold down Numpad8 key, it'll show a Tooltip with a number and count up to 5 while Numpad8 is held down. It sto...
- 08 Apr 2024, 21:36
- Forum: Ask for Help (v2)
- Topic: Key Hold to Run script question
- Replies: 23
- Views: 445
Key Hold to Run script question
I want to create a script that only runs when i hold down a key or the mouse button and it stops when i let go. Is there a way to create such a script? Basically when i run the script, nothing happens until i hold down the specified key and when i let go, the script stops. then when i push the key a...