Autohotkey how to press a key.
Autohotkey how to press a key.
Autohotkey how to press a key How do I do this? So my ideal scenario is if I hold down or press Alt, the moment it gets pressed, the shift button gets pressed. This way, you can make any key a hotkey, without any modifier key. #IfWinActive ; This puts subsequent remappings and hotkeys in effect for all windows. One of the most common uses for AutoHotkey is to create loops that repeat a certain action until a specific key is pressed. I found some scripts in the old forum and in the help, but I can't figure out how to combine them. If you define a hotkey in your script (^s:: ) you have to press this key combination to execute the command. For some reason it will start but when I press F3 again it doesn't stop. Send the key in a burst, wait some time and burst again. ~jaco0646] Send {DEL 4} ; Presses the Delete key 4 times. How can I have it start with ALT+2 but stop by pressing any key? #MaxThreadsPerHotkey 3 !2:: ; ALT+2 hotkey #MaxThreadsPerHotkey 1 if KeepWinZRunning { KeepWinZRunning := false ; return ; } ; Otherwise: KeepWinZRunning := true Loop { ToolTip, Press ALT+2 again to stop. It's easy to start a loop with a key, but the knowledge of this one comman Jan 13, 2024 · However, I am facing an issue when using Ctrl key together with another keys like z, c, v, etc. Sep 13, 2011 · If you dont mind using other key to pause/continue, you can write a more simple code that doesn't use settimer. To just press (hold down) or release the key, follow the key name with the word "down" or "up" as shown below. I am hoping to make an AHK script that presses a certain key every X seconds, but I have no idea where to start with this. I tried all the codes in this thread but nothing seems to work. This keeps on going until I press F2 again. Can anyone give some help on how to accomplish this? Jul 22, 2020 · If I press the number "7" I would like the computer to hit TAB six times and then press enter. "c:\program files (x86)\autohotkey\autohotkey. 3. Now, mind you that I'd like for it to behave exactly as a left click, meaning if I hold the key, the system will understand I'm holding left click, NOT spamming it. Now, I do know that a simple workaround for this would be to map the XButtons to some rarely used keys like RShift and RCtrl, but what I want is a more elegant and direct solution to this problem. Apr 3, 2004 · Loop until key is pressed? - posted in Ask for Help: Baisically, I have a script set to loop and click at different locations every few seconds, which looks like this: #x:: Loop 100, { LeftClick, 530, 378 Sleep, 100 Send, Text Sleep, 100 LeftClick, 472, 415 Sleep, 100 LeftClick, 520, 552 Sleep, 100 LeftClick, 470, 580 Sleep, 100 } It does indeed need to loop roughly this fast to get the Sep 6, 2006 · This is straight from the manual - I haven't done much with pressing keys more than once, but this looks pretty simple. I am using a mouse with multiple side buttons; I'm using G Hub to send F24 when one of the mouse buttons is pressed. I would like to be able to left click using a keyboard key. To avoid that, I have a simple one-line AutoHotKey code to disable the CapsLock key. Jun 23, 2015 · Thank you for the answer. Jun 4, 2011 · In the way that you've done things at the moment the first key is released before the second is pressed. Remapping a key or button is "complete" in the following respects: Mar 11, 2021 · im sry for my bad english maybe i didn't notice you what i want you can see this script this script is like when i hold some hotkey like 1-2-3 it start spam it on my word of warcraft so right now i want the command for "TAB" when im hold tab i want it to spam tab so i just tryed to swap a like for comand to and it's not work when im switch this command Oct 16, 2023 · I use it daily for various things like keyboard shortcuts, key blocking, auto-correct, automation, etc. eg. The nice thing is that this doesn't interfere with other keypresses, as it allows you to hit multiple keys and Send {DEL 4} ; Presses the Delete key 4 times. Code: Select all ^+F1:: Send {Esc} Return ;This presses Escape after you press Ctrl, Shift, and F1 on your keyboard. Jan 24, 2006 · loop until i press a key - posted in Ask for Help: i really have a problem with thisheres a example:loop { Send, text1{enter} Send, text2 Esc:break }and it only executes whats in the loop oncei want the loop to repeat until i press Escthank you Hopefully, this is what you're looking for. 5. In spam() the actual process will be triggered. You can, indeed, use a batch file to run a autohotkey script. So I press the key once and it sends Ctrl+Alt+Shift+1 then the next time i press it whether its immediately or after a few hours it will press Ctrl+Alt+Shift+2, then on the third press it will again press Ctrl+Alt+Shift+1 and so on. Select the menu item "View->Key history" Scroll down to the bottom of the page. Thanks for the help. But I need the key to be pressed on the desktop (so it doesn't effect any open windows). Jan 27, 2015 · easy script to repeatedly press up/down arrow keys? - posted in Ask for Help: Hey there, Im new to AHK scripting and I would like to know how I could make a script that will simply press the up arrow key followed by the down arrow key and have this on a constant loop? Thanks in advance! Could someone please make me a script to press my enter button every 30 seconds on loop? Want to use it for a game and can’t figure out how to use autohotkey Also wanted to start it with maybe shift enter and end it with windows enter if that’s possible Been looking for this for sometime now and can't find it anywhere. com. Replace the tooltip with the action you want. So I made a script like this:1::Send {s down}{d down}{s up}{d up}But it doesnt work. May 16, 2011 · How to send two keys at the same time? - posted in Ask for Help: I have a game that I need to press two keys at the same time. Get a room of typewriters, and a monkey for each one. Rebinding a key is like saying "When I press this key, do this:" - in this case it's under an #IfWinActive so it's more like "When this window is open and I press this key" When you break that down you have "When I press enter - press F2" as well as "When I press enter, press enter" 2 - Assign macro to the key you want to make auto walk, and select 'toggle' as the action when you press this key. Nov 15, 2023 · Either that or it can maximize or select Firefox when it needs to, and then press the keys (then minimize it again, or set the previous active window as active). This is because A presses Ctrl+Shift+A and a presses Ctrl+A. I don't know what to do now. All I want to do is send a series of keystrokes. Jun 12, 2022 · I am trying to use a shortcut/hotkey, lets say the space bar, which when pressed should trigger a sequence of keys to be pressed (like P Q Q T). Check Your Keys If after pressing the keys lit up on the virtual keyboard, then your key is working properly, if the key is not highlighted, then there are problems with its work. It opens the task view and waits for the user to click, escape or enter. The following example remaps the left Win key to become the left Control key: *LWin::Send {LControl down} *LWin Up::Send {LControl up} Jun 28, 2020 · else this. etc Dec 8, 2020 · Sidenote: In the context that I am using it, return just means to stop executing a multi-line hotkey. Press Enter. www than keyTweak program assumes Sep 19, 2017 · I want to press a key (for example here, q) and have that activate and hold the e key for 10 seconds. exe") ; Make sure to set this *a::key_swap('a', 'd') ; when a is pressed, release d and hold a *d::key_swap('d', 'a') ; when d is pressed, release a and hold d #HotIf key_swap(hold_key, release_key) { If GetKeyState(release_key) ; Check if release key is being held SendInput('{' release_key ' Up}') ; If yes, release it SendInput Apr 12, 2020 · For some reason, I can't find a way to achieve this simple action: I need the same key that is pressed repeated several times. In case you want the Auto Key Presser to keep on pressing and releasing Keyboard Key infinite times, enter 0 in the Number of Keys to Automate edit control. The object I want to interact with is toggled by pressing the "E" key. exe to prese the keys after a few seconds I'm using a program called Maximus ARcade to launch several emulators, but one kept launching in windowed mode, Maximus arcade gives you the option of launching a program before the emulator, during, or after Someone already gave you an answer but remember there are many solutions to the same issue, it depends when you are satisfied. It's also worth mentioning that there are legitimate reasons to use other send modes. i know this can be done with SetKeyDelay, x, y. Typing text is simpler, so we'll start there: just call the SendText function, passing it the exact text you want to send. Jul 22, 2020 · If I press the number "7" I would like the computer to hit TAB six times and then press enter. from what i have been able to see online, ( Send {f7 down} ) wont hold the button down but only tap it without letting up. In other words, com thinks I pressed Ctrl + p multiple times. Dec 26, 2023 · AutoHotkey Loop Until Key Pressed: A Beginner’s Guide AutoHotkey is a powerful scripting language that can be used to automate tasks on your Windows PC. Here is what I have so far: WinWait, NetWinner. A keypress can be created with the Send, {key} command but you can also do the following Send, {key down}, followed by a small delay, and Send, {key up}. ahk" And in your autohotkey script, do something like this: send ^!1 exit That Jan 27, 2015 · easy script to repeatedly press up/down arrow keys? - posted in Ask for Help: Hey there, Im new to AHK scripting and I would like to know how I could make a script that will simply press the up arrow key followed by the down arrow key and have this on a constant loop? Thanks in advance! Jun 28, 2020 · else this. Of course, with a little practice you can get used to the correct timing. Feb 5, 2007 · (noob): get scancode of pressed key - posted in Ask for Help: hi! i would like to get pure scancode of the key that was pressed. When the other key is not one of the numpad numbers, I want to only send the other key. I want that to be the same key. For example, using the hotkey Escape, I want the Down key to be pressed, and then the Up key to be pressed. 8. The monkeys will type away (likely with 4-5 letters at a time). But isn't there a possibility to completely avoid sending the X after a long press, even if it is pressed longer by accident than it is supposed to be pressed? Thanks. I want it to work like they would work if I pressed them both at once. Jun 4, 2016 · The setkeydelay, 1 means the delay is only 1ms which is fine since you are using sleeps before the send f, With games you want the key duration to be set which is the next parameter in the SetKeyDelay command. I need the script activation to be toggleable (for example if I press F5 while it's running, it stops. For example: Send {b down}{b up} Send {TAB down}{TAB up} Send {Up down} ; Presses down the up-arrow key. As title says, is there any script available that I could change the data of it, which will let me press a button to start the script, and have the script press the key "C" for example, every 7. . What I want is for the script to start pressing "Space+S" at the same time, when I press "End" and I want a key combination, let's say "9+0" to be pressed at the same time, to end the script in its track at any given time. Now when I open the game and run it, it doesn't do anything. Can the number 4 and 5 act like its being pressed down when im pressing a and d? Is there way to add a command this will only happen when I hold down mouse 2 and when I let go it cancels the whole command? Assuming that with "mouse 2" you mean the right mouse button (also see key list for other keys) (untested) : May 3, 2019 · If you want to get the > character, but you press it too long, then some Xs are sent. Mar 20, 2025 · 1. NOTE: Some keys do not generate events and thus will not be visible here. Then press the same shift key when Jan 29, 2017 · So basically, anytime CTRL + another key is pressed, I want to check what the other key is. what i wanted is a more interactive method, for example, if i was to I am trying to map a mouse button to mimic a single press of a ctrl key on the keyboard. Jun 16, 2011 · Press a key every X seconds? - posted in Ask for Help: Hello everyone. How Oct 23, 2015 · Is there a way to press two keys simultaneously and bind it to a macro key (for example, pressing "s" and "d" simultaneously and then bind it to "a" key) without it having the "s" repeat multiple times when a is pressed? Another example - I wrote the script in AutoHotKey as: a:: SendInput {s down}{d down}{s up}{d up} return Oct 21, 2010 · Page 1 of 2 - How to make a key press repeatedly while its down - posted in Ask for Help: Hi guys, what would i have to type down for:If I hold down the W button, it will keep spamming W at 100times a second while its down. dunno how to explain it better Sep 13, 2010 · I know one way to get multiple keys pressed at the same time. I'm able to do assign a hotkey with only F24 and a letter key. Can anyone give some help on how to accomplish this? Mar 20, 2017 · I want to bind 2 keys to 1 key press. Just to be clear: I want it to repeatedly send the 1 key input and not send the command to hold the 1 key down without typing anything. After the above keys are pressed I then want to press the "q" character again (separately, not at same time). For example: Send {DEL 4} ; Presses the Delete key 4 times. That could include: While the key is pressed keep sending it fast. Jan 15, 2019 · I press a button on my keyboard, for example F2. when you press some button/textbox - you will have some note (doesnt matter) and the next pressed key will be saved. letter B and number 1 pressed at same time wil send letter P. The gray area is where you use 1 button press for multiple actions like pressing 1-2-3 at intervals. function:="" } enableFirstUp(enable:=1) { ; Enable the first key in the long hotkey to trigger its normal press event on its release, in the case when no other keys in the long hotkey was pressed. 4. May 7, 2025 · You're trying to rebind the enter key twice. Configure the Number of times you want the Keyboard Key should be pressed and released. I have tried . Click AutoHotkey Script. When sending keys, you generally want to either send a key or key combination for its effect (like Ctrl+C to copy to the clipboard), or type some text. ; If one method doesn't work in your program, please try the other. Nothing happens, but when I open the chat window in the same game, it types "E" every 8 seconds. And when Im not holding down W anymore, it stops?Thanks. Jul 26, 2015 · Repeating one Key - posted in Ask for Help: Hello, I wrote a very simple script, which should repeatly send the same key. e. What is AutoHotkey. When you press F2 the script will be stopped. What can be changed so that when the shift key is pressed and held indefinately, it will only send z once. Braces are used to enclose key names and other options, and to send special characters literally. Feb 8, 2023 · The keyboard driver does not expose the Fn key to the operating system, so basically your operating system (and therefore AutoHotkey) does not know that it exists. For example: Send {Up down} ; Press down the up-arrow key. Loop { ControlSend, {F11}, WindowsApplication1 Sleep, 100000 } but doesn't seem to work. autohotkey. Right-click the desktop and click New. 33. This script can be used for double pressing To hold down or release a key, enclose the key name in curly brackets and then use the word UP or DOWN. $1:: ; Hotkey that starts the script. for example: If I press or hold 'A' it should press/hold 'A' & 'RAlt' without any delay or duration limit. For example say a:: Enter hi Enter return But that does not work sadly. I am aware this is probably a very crude way of doing it, but it works . i will mess with registry to remap some hotkeys, because i do not like the idea of background processes, but i cant figure out what scancode is sent. Say I need the key a to be repeated twice when I press it. Mar 22, 2022 · Sometimes I stop holding W while still pressing Q and W stops being pressed then after a second it activates again. Should this work flawlessly for pressing both at the same time? 1:: Send, {a} {b} Return If those don't work for pressing "a" and "b" at the same time, would it be necessary to do something like this? Jul 30, 2014 · It doesn't start capturing the screenshots until I manually press Ctrl + S. Any It seems the windows key is not working as long as either ctrl or alt is pressed. I enter the following: Esc:: { Send Down, Sleep 10, Send Up } AutoHotkey Feb 28, 2010 · F2:: If State=50 State=Off else State=50 SetTimer SendKey, %State% Return SendKey: Send e Return This is one Way PS Spamming keys is a comon question please use "search" first next time #IfWinActive ahk_class Notepad a::b ; Makes the 'a' key send a 'b' key, but only in Notepad. So I need a script that can reliably hold the button pressed AND another button and work reliably even if that another button is pressed and released multiple times. 5 seconds, until I deactivate the script? If I am explaining myself correctly. I need it to work like normal key presses. 0+ #HotIf WinActive("ahk_exe gameName. 1. Type "Return To press Ctrl+Alt+Shift+2 I can define the shortcut without modifier if that make it possible. Aug 16, 2017 · I'm attempting to send three keys (Alt, Shift, Q) at same time using this script: :*:pk:: ; Send, {AltDown}{ShiftDown}{qDown} return When I run this is it does not release the keys, it seems like the Alt button remains pressed. Have you ever needed to press a key every couple of seconds, or every few minutes? Perhaps you're playing a video game and you're waiting for an item, or you've got some other reason. Feb 21, 2010 · typing a word after pressing a key - posted in Ask for Help: Hello Im totally new with a hotkeys and after spending some time with trying to understand and find cmd which could satisfy me i decided to ask for help. You need to tell AutoHotkey to hold the key down. But if I press p multiple times, it is recognized by computer while ctrl is being held down. *w:: Send {w}{k} If you want more commands after that, you'll have to do something like this: *w:: Send {w}{k} ; More code return Aug 23, 2016 · Hi there, I want to make it so when i PRESS Left Alt, the shift key gets pressed. Nov 1, 2015 · I try to write a script letting a single button perform three actions, one on single press, one on double press and the last one if you press the button for some time. Regarding "other" three key combinations, the documentation currently states: Combinations of three or more keys are not supported. I am trying to map a mouse button to mimic a single press of a ctrl key on the keyboard. Note: A produces a different effect in some programs than a. Aug 4, 2012 · To hold down or release a key: Enclose in braces the name of the key followed by the word Down or Up. Type "Send" followed by the word(s) or command. Aug 16, 2017 · Try using Send {Tab 10} To repeat a keystroke: Enclose in braces the name of the key followed by the number of times to repeat it. Please let me know if this works for you all. The same is true for other keys like NumLock and ScrollLock. Mar 13, 2016 · This was mainly to remap the Windows+Tab key to the Alt+Tab key in this example. Whereas Hotkey 'q', 'l' work as intended. Walden shows you how to make your AutoHotkey script while your keys are held down. In your batch file, just run autohotkey and send the path to your script as the parameter. Also the help/tutorialpages from autohotkey itself are very bombastic. I would like to execute a loop infinitely, but I would like this loop to stop as soon as a key (any random key) is pressed. You can adjust the amount by changing the number "5000" in the script (the value is in milliseconds). What your example above does is send the word "return". Feb 17, 2015 · After you start the script pressing F1 will run it: a letter "q" will be pressed every 5 seconds. I have watched tutorials but all people ever really cover is the mouseclicks. Mar 26, 2012 · How to tell my computer to press tab - posted in Ask for Help: Hello I am a student, and every time i want to use internet at my school i must put in my username and password. This is whats happening. When you press the Fn key in combination with a supported key, the keyboard driver reports a single key press to the operating system with a different scan code. 2. Either way, here's how to make your PC do it automatically. May 19, 2012 · Page 1 of 2 - Long keypress - hotkeys w/o modifiers - posted in Scripts and Functions: The following is not so much to demonstrate my superior skills as a programmer :roll: , but rather to promote an idea of mine (yes, I actually thought of this myself!): to differentiate between a long press and a normal press of any key. To hold down or release a key: Enclose in braces the name of the key followed by the word Down or Up. Send +{TAB 4} ; Presses Shift-Tab 4 times. But on key press, fire the spam() function. Dec 3, 2013 · To start and stop the script the ALT+2 is pressed. I want to press the Left shift button down and have it send a double mouse click, then do nothing until the left shift is released, then upon release, send a double cl Sep 27, 2022 · Avoiding loop when Double pressing same shortcut key without changing original 1 press shortcut key function (Autohotkey) 0 Autohotkey: Repeating keypress with key modifier held down Press 2 buttons at the same time? - AutoHotkey Community Oct 27, 2020 · Hello, I have just started using Autohotkey and i am trying to make a srcript that keeps pressing the key F1. a:: loop { tooltip % "send enter" a_index ; just for tracing, delete if not used send {enter} sleep 1000 ; 1000 ms = 1 sec, change to sleep 60000 for 1 minute delay } return esc::pause ; esc = pause, esc again = continue ^esc::exitapp ; ctrl+esc = terminate program This allows you to control the speed with which the selected Keyboard Key is pressed and released. The script which i want to make more faster: To start the test, simply start pressing the keys on your keyboard. Maybe someone will help with upgrade my script i will be glad. – Feb 10, 2014 · I read in some post that Autohotkey allow to set two keys pressed at same time to send another key, i. Jan 27, 2012 · How to detect if a certain key is pressed and held down? - posted in Ask for Help: How to detect if a certain button is pressed and held down at the moment?For example:n:: [color=red]if o is pressed and being held down:[/color] msgbox, well send on because o is being held down at the moment else send n return Jun 12, 2022 · AutoHotkey Development AutoHotkey_H Ask for Help Development Editors Adventure IDE Old Topics AHK Studio Notepad++ Pulovers Macro Creator SciTE4AutoHotkey Visual Studio Code Announcements General Discussion; AutoHotkey (v1. com - Windows Internet Explorer, IfWinNotActive #Requires AutoHotkey 2. All scripting follows the rule Rule Of Twos -- 1) Good, 2) Fast 3) Cheap -- pick any Two. #SingleInstance Force ; Ensure only one instance of the script is running ; Register the hotkey to start the key press loop ^j:: ; Control+J hotkey StartKeyPressLoop() return ; Register the hotkey to stop the key press loop ^k:: ; Control+K hotkey StopKeyPressLoop() return ; Global variables May 27, 2017 · Go to this link to see what AutoHotkey can help you with in your daily life on the computer. How to toggle script on/off with a key? - AutoHotkey ; AutoHotkey Script ; This script will repeatedly press the key that is currently pressed. The problem is, that the script presses F1 once and it stops. I would like to combine these in to one, but i need the computer to automatically press Tab in between so the cursor moves to the next text box. Somewhere near the bottom are the key-down and key-up events for your key. Oct 23, 2017 · Using it, if you have no other means of repeated key pressing is fine, if you use it for 1 button press = 1 action. More so when you start scripting AHK to play for you and move your mouse pointers etc to X,Y co-ords etc etc etc. Aug 24, 2018 · Now the problem is that I don't want to mess anything up so I am not executing it already. If I press F5 again while it's stopped, it starts). I looked for this specific problem in the forums, but so far I haven't find the solution. For instance, I accidentally press the CapsLock key all the time. Install AutoHotkey from https://www. In short: How do I write an autohotkey script so that when I press, say, F1, it presses the mouse button down and only lets it go after I let go of the key? I did some research on both autohotkey forums (which redirect here for asking questions) and read through the documentation, but I'm no programer and have a difficult time grasping loops. 9. 7. 6. Is there anyone here who wouldn't mind writing that out for me? Also, thanks in advance for anyone who does! ~iiPMG - YouTube Gamer Nov 30, 2013 · Assign continuous key press to button - posted in Gaming Questions: What I want is simple: 1. Apr 21, 2023 · autohotkey: How to make right mouse key mimic itself and the functions of left mousekey at same time? Hot Network Questions Can I use an ESTA to visit my boyfriend before my F-1 visa is valid? the solutions that i have looked up loop through pressing the key over and over ( Send {f7 down} ). Cheers. Aug 19, 2021 · It doesn't only trigger ^{Space} on pressing Shift alone, it also triggers on Alt+Shift (just these two keys) and Ctrl+Shift (just these two keys) if Shift is the last released, is there a way to trigger ^{Space} if Shift is the only key being pressed? AutoHotkey Version: 1. So i have a hotkey for my username, and a separate one for my password. Right-click the script icon and select Edit Script. I'm going slightly crazy getting the basic functionality of AHK V2 going. If it's sending Z and 5 too fast, make it where it sends the key down, then sleep for a short period of time like 50 then retype Send but instead of having key down, put the key up. Same thing with the other code someone suggested. I want to have a script do the following: Click a button X send key: tab send key: uparrow send key: enter So far i have : ControlClick, submit, ahk_class #31111, , , , sleep 150 SendInput TAB SendInput {Up} SendInput {enter} Press a Key every few seconds - AutoHotkey Community Jan 8, 2013 · >> I'm not sure if when I tried I forgot to put the first line beneath the hotkey >>or if it's just the return at the end that was missing - probably it Jul 20, 2011 · detect key pressed - posted in Ask for Help: hey guys! I need some function that will detect pressed key. Try this: 1:: SendInput {c down}{f down}{k down}{c up}{f up}{k up} {enter} Return This tells AutoHotkey to press the key, but don't forget to tell it to lift the key up again afterwards ;). And if I were to release alt, nothing would happen. The following script works for me: <^LAlt:: KeyWait Alt KeyWait Ctrl Send {RWin} return <!LCtrl:: KeyWait Alt KeyWait Ctrl Send {RWin} return You can press the left Ctrl and left alt in any order, and when you release both, the windows key is generated. 2 - Assign macro to the key you want to make auto walk, and select 'toggle' as the action when you press this key. Also, I was wondering if its possible to have any ONE of the following (in order of importance): -Make the script happen behind the scenes, meaning it would send the key press to a certain program, even Apr 8, 2020 · 1) Pressing G to activate G;Z;X;C;V;B;N;M;SPACE keys respectively with a 50ms delay between each activation (otherwise only the "G" key will work, I've just tested it) 2) After the whole script is executed, I need it to be turned off so I can type regularly mid-game if necessary Jul 8, 2020 · And the template EJE is referring to is the template file that is created when you create a new script by doing Right Click > New > AutoHotkey Script, and I can confirm it does have a SendMode Input line at the top, which affects all subsequent calls to Send. Thanks in advance! ⚠️ But don't click on Pause Script, otherwise remapped keys will be shutdown. When a key is held down via the method above, it does not begin auto-repeating like it would if you were physically holding it down (this is because auto-repeat is a driver/hardware feature). AutoHotkey is a free, open-source scripting language for Windows that allows users to easily create small to complex scripts for all kinds of tasks such as: form fillers, auto-clicking, macros, etc. Mar 14, 2016 · So, for example, on pressing RAlt DOWN, this triggers the repeated pressing of the space key (NOT holding space down, but Space DOWN, Space Up, Space DOWN, Space UP etc). Thanks, It kinda works. Mar 10, 2022 · I tried to disable the key from within the mouse software but that just caused the hotkey to stop working completely. If not please let me know and I'll try to explain in a different way. Also, if you have suspended the hotkeys, the H will become a S. I'd like to know how to script so that two keys pressed and held in a specific order will press another key. try it with 50 like i have it in this post. Enter the code for the keyboard shortcut followed by two colons. I would then scan a barcode and then press "8" and it would press TAB 3 more times, I would scan another barcode, and then press "9", which would be TAB twenty-seven times and then press enter. When you press a key, a tooltip pops up, showing the name of the key (edit the list for non-US keyboards). The example from the help page has the alt key getting stuck for me so I changed it to work a little better. exe" "c:\scripts\hotkey. I have the following code: The word UP may follow the name of a hotkey to cause the hotkey to fire upon release of the key rather than when the key is pressed down. Basically, it tells To hold down or release a key, enclose the key name in curly brackets and then use the word UP or DOWN. If I remove the inner loop and just put a sleep 300, it works but stoping it becomes hard then, since he doesnt react to the e key while sleeping. For example, Send, ^!a would press Ctrl+Alt+A, and Send, ^{Home} would send Ctrl+Home. For an example a script that presses the w key and when you activate it, your character in a game walks forward instead of you just typing w, same situation for the enter key. Cheers! May 14, 2007 · Breaking an infinite loop with keypress - posted in Ask for Help: Hello. By default, Send will not automatically release a modifier key (Control, Shift, Alt, and Win) if that modifier key was "pressed down" by sending it. (ctrl is used in a game I am playing to toggle displaying some extra info on the screen) I've tried this but it doesn't seem to actually send the ctrl key: RButton:: Send ^ Return May 8, 2006 · This script defines every key on the keyboard as hotkey (except the numpad keys, which you can add if needed). For example:; This is how you hold one key down and press another key (or keys). And then I want that sequence to be repeated every 15 seconds in perpetuity (or until I press the hotkey button again, which should pause/stop the automatic loop/repeat). When F2 pressed, it starts a loop that presses F9 every second or so. Hope this helped. Then on lifting my finger off the RAlt key (so this would be RAlt UP I guess), the action would immediately stop. Apr 21, 2020 · I want to press a function key (F#, not the key that is labeled "fn"), a modifier key, and a letter. Press one of the "mystery keys" on your keyboard. Thanks Locked post. So I'm trying to have that mouse button act as another modifier key. The nice thing is that this doesn't interfere with other keypresses, as it allows you to hit multiple keys and Learn AutoHotkey, and automate your daily tasks. For example: Send {b down}{b up} Send {TAB down}{TAB up} Send {Up down} ; Press down the up-arrow key. Mar 19, 2010 · ahhh i see, thank you guys you are really helpful, I just want to launch autohotkey. Enable/disable the script when INSERT key is bumped 2. Aug 24, 2021 · I have a problem, i was searching and testing scripts to very fast pressing few keys in keyboard, they doesnt work, i have one script which working but its very slow even if i change values it makes no matter. Mar 15, 2011 · What i want is when i press w a s d one more key get pressed and it dont really mater with key it is it can be w+ctrl, w+k as long as both keys get use when i press 1. Start sending the key and don't stop until the key is pressed again. Jul 27, 2016 · Here's what I'm trying to do. [Deleted double post. Apr 26, 2025 · Hello AHK forum community, I have an IBM Model M, and would like to simulate a windows key press, preferrably to be able to be used such as how I would do actions such as Win+R and Win+Pause/Break while still having the functionality of being able to press the simlulated windows key. When the key is one of the numpad numbers, I want to send CTRL and the numpad key. If you want to send a special key like the right arrow button or the return/enter key, you would have to enclose it in curly braces {}. For instance (not efficient but I suppose easy to understand Dec 20, 2014 · How to make a script that makes | Enter, (text), Enter | ? - posted in Ask for Help: Hi I want to write a small script that binds to a key the following combination of commands, press enter, write the following text, press enter. how would you solve my problem? here is the template of code that i used Jan 23, 2015 · The universe is a wondrous place! The faster you create unbreakable code, the faster the universe creates people that can break it. For example, Send "a" may behave similar to Send " {Blind} {Ctrl up}a{Ctrl down}" if the user is physically holding Ctrl , but Send "{Ctrl Down}" followed by Send "a" will produce Ctrl + A . Hotkey Declaration: When Ctrl+w is pressed. When RMB is pressed, spam the Q key Ive tried this and other similarities with no luck: #Persistent if Rbutton = true { while true { Send q sleep, 50 } } Is this easy to make? Dec 8, 2020 · Sidenote: In the context that I am using it, return just means to stop executing a multi-line hotkey. To hold down or release a key, enclose the key name in curly brackets and then use the word UP or DOWN. In these cases, the script detects these combos as a long press on Ctrl key and dispalys the "Long press" message box. Don't worry, you can use the Tab and ↓/↑ keys to navigate it and the Del key to Apr 16, 2018 · Per the official AutoHotKey Mouse, Joystick and Keyboard Shortcuts documentation: ^!s::Send foo Note, however, this only works with multiple modifier keys (Ctrl, Shift, Alt). For example: Jun 18, 2021 · Declare a variable to hold the amount of time you want the hotkey to wait for an 'x' input after Ctrl+w is pressed, called delay. Skip the actual key press action. Wait delay number of seconds for the user to press another key; If that key was x, then send your custom hotkey; Otherwise, send Ctrl+w, followed by whatever key was Aug 10, 2015 · This script is suppose to start/stop when a key is pressed. To be specific I'd like to press tab and then q and receive the output of F1. 1 and older) Ask for Help (v1) Gaming Help (v1) Scripts and Functions (v1) Gaming Scripts (v1) Tutorials (v1) Send {Up down} ; Press down the up-arrow key. Mar 26, 2015 · Do something while key is held down - posted in Ask for Help: This is my script so far: RShift:: If(GetKeyState(RShift, P = 1) Send {z} else Send {RShift} The problem I have right now is that when the shift key is held down, the program keep sending z. I found a similar code on the documentation, but that code executes a loop when a key is held down. It will slowly count from 0000 to 9999 and will remember where you are when you stop the loop. For example, {Tab} is the Tab key and {!} is a literal exclamation mark. (ctrl is used in a game I am playing to toggle displaying some extra info on the screen) I've tried this but it doesn't seem to actually send the ctrl key: RButton:: Send ^ Return The original question was tagged autohotkey. Remove the key names from the lists you don't need to monitor. May 5, 2019 · Press the t key to toggle the 1 key being held down so that it types a bunch of 1's indefinitely until I press the t key again. g. i am using ultrax keyboard and it seems to send some different scancodes for e. Nov 20, 2013 · I need to press any useless key (like F11) every 5 minutes or less to keep the windows active (if it became inactive for 5 minutes it will lock-out). however x and y need to be a numerical value, which means you need to know exactly how long you want to hold the key down for. If your programm needs this hotkey to save the screenshot then you have to define another hotkey to execute the command. 09. Sleep 1000 ; Keep it down for one second. Send {S 30} ; Sends 30 uppercase S characters. Instead, I want it to ignore any combination of Ctrl + other keys and allow the default system behavior. Then when you press the auto walk key, Synapse knows to keep W going until you press the key again to toggle it off. Moreover as p is assigned as hotkey, it shouldn't be input. When I try it out on notepad, it works, it types "e" every 8 seconds. This Here's an example of how to toggle a key using the key itself; change the key on the first line to the key you'll be pressing, change the other three to the key you Jan 5, 2010 · how to make AHK to send keypress as if it is held down? - posted in Ask for Help: i want to use AHK to send a key from the keyboard as if it is held down. F2::PressE() PressE(){ Loop { Send e Loop, 300 { if GetKeyState(e){ return } sleep 1 } } } It only sends the key once tho. Send> {Up up} ; Release the up-arrow key. Dec 20, 2014 · In this way, there would be a brief pause between keypresses and each key would be pressed a lot more like a real person would, thereby alleviating your probem of autohotkey sending keypresses faster than they can be registered. Edit:- If you cannot use the mouse, you can always press Ctrl+Shift+Esc to open up Task Manager. For convenience, you can use the full screen mode, and also select light or dark mode. Example I press F3 to start and I press F3 again to stop it. etc Dec 17, 2015 · Ctrl is held down with pressing p, but it isn't released even if I press p again. lpw xwf kcqui doyvysn cmoey xnir naw byhcy hlrjgd ugji