Looping While Holding Keys | AutoHotkey Tutorials

preview_player
Показать описание
Walden shows you how to make your AutoHotkey script while your keys are held down. It's easy to start a loop with a key, but the knowledge of this one command you can loop your script.

Script:

x::
While (GetKeyState("x", "P")) {
Send 123
Sleep 500
}
Return

Рекомендации по теме
Комментарии
Автор

Bro your channel is a hidden gem for automation enthusiasts!

guptabhishek
Автор

Great job @Walden's Automation! I love seeing other people also putting out great AutoHotkey tutorials! Kudos to you!

JoeGlines-Automator
Автор

Im so confused I just want that while I have a window opened, while Left Alt is being pressed (without any other key pressed at same time), it behaves like I'm being pressing A for example.

KilluaAdventures
Автор

I used the following script to autorepeat the 1 button, but if I press it a few times it randomly breaks by continuously looping forever as if I never let go of 1, until I press again. Any idea?

petrdvorak
Автор

Great tutorial... Is it possible to use L button with Mbutton of the mouse together? Like if Lbutton is pressed down and the Mbutton is also pressed down and then lifted then it goes back but not using any F1 button, just with simple Lbutton pressed . I’m really new to this, but if possible can you please help me with the exact script on how it can achieved? Thanks 😄

harsimransingh
Автор

I used the following script to autorepeat the 1 button, but if I press it a few times it randomly breaks by continuously looping forever as if I never let go of 1, until I press again. I tried playing with Sleep time, toggling sendmode, but without sendmode input, repeat is too slow. Please help.

SendMode Input
#InstallKeybdHook
$1::
While (GetKeyState("1", "P")) {
Send 1
Sleep 1
}
Return

jetkhan
Автор

How can I make like a script to loop the shift button while holding it? Im so bad at doing ahks xD

Silver.....
Автор

What if the key i want to press is the space bar?

BurlyFire
Автор

How to create scipt that if i press g button it holds down w button untill i press g or w?

ascelot
Автор

Please help me. It doesent work when i replace x with alt am i doing something wrong?

Mia-czcj
Автор

How about Hold down Spacebar key for spacebar loop, basically for bhop type of thing, and what's the "codenam" for spacebar? Is it "space" is it "spacebar" or is it " "

iceorangutan
Автор

WOW GOOODDD!!!
But what if I press x key, and program start loop, then press x key again, program stop?

banyakbacot
Автор

exactly what i needed but can i hold down mouse 1 for left clicking and LControl at the same time?

caliban
Автор

i have a problem, i'm making a script that holds Q when i hold W
but after i let go it doesn't stop, how do i fix this?

parks-
Автор

hello i have a question so .... on my desktop pc i have keyboeard and on the top it has multimedia keys like play stop next previous so i remaped for example stop key into volume up, and it works but problem is that if i hold the key it does nothing so if i want make volume upper i have to keep pushing the key .. so what i have to do if i want to press and hold and see how volume is changing continously ...

sandrotsomaia
Автор

I made multiple different x, y position macro but when I press my keybind it does the first script then stops how do I make it do the second one

hsbdbsjsjebbdbsbsb
Автор

What if i want to key 1 keep repeating itself untill release?

I couldn't do this with this script, would u mind helping me out?

matosrennan_
Автор

How to do a script for example if i click "g" it will click "5" on my keyboard and then hold my right mouse button for 1.7 second and after it stop holding the button for 1.7 second it will click "1" on my keyboard? Pls tutorial

kefir
Автор

a quick tutorial for keyboards G keys would be great

LSCrazyCabCo
Автор

hey, turns out the example script you showed is exactly what i’m trying to make. If you still have it, could you link a pastebin for it please?

rrogance