r/AutoHotkey

New to Hotkey, nothing I do is working

I'm trying to change wasd hotkeys to arrowkeys whenever I open roblox using this code, but it doesn't work. Idk how to code, I just copy pasted it

#HotIf WinActive('ahk_exe Roblox.exe')
w::Up
a::Down
s::Right
d::Left
#HotIf
reddit.com
u/Zaorick — 10 hours ago

Windows key, Copilot key, and AutoHotKey

I wrote a script to remap the Copilot key (which sends F23) to launch an app. The hotkey was #+F23::, so it used Win+Shift+F23 as the trigger. While the script was running the Win key stopped working entirely — pressing it did nothing.

I assumed closing the script would fix it, but it didn't. Rebooted, still broken. The Win key doesn't register on online key testers like key-test.it. Checked the registry at HKLM\SYSTEM\CurrentControlSet\Control\Keyboard Layout and there's no Scancode Map entry.

The interesting part: when the script is not running, the Copilot key now opens the Windows Search panel instead of its default Copilot behavior — suggesting Windows is somehow treating the Copilot key as a Win key input rather than the Copilot key.

I tried changing the hotkey to F23:: (removing the Win modifier) but that didn't bring the Win key back, which also suggests the issue existed before that change.

Anyone seen this before? Is using # as a modifier known to cause this? Looking for a way to restore the Win key short of reinstalling Windows.

#+F23::
{
    if WinExist("ahk_exe dtSearchw.exe")
    {
        WinActivate
    }
    else
    {
        Run '"C:\Program Files (x86)\dtSearch\bin\dtSearchw.exe"'
        WinWait "ahk_exe dtSearchw.exe"
        WinActivate
    }
}

PD: I may have done some regedit shenanigans under the influence of AI (big noob here) so take that into account.

reddit.com
u/Vegetable-Willow246 — 1 day ago

i keep getting "This line does not contain a recognized action" error.. plzhelp

my script is literally just 1 line long

PgDn::Enter

what the hell am i doing wrong

reddit.com
u/imthelagking66 — 3 days ago

I made a customizable desktop launcher with interactive menus

I made a customizable desktop launcher that lets you organize apps, files, links, and shortcuts into interactive menus with custom buttons, emojis, and icons.

The newest update adds an image gallery/icon picker, UI improvements, smoother scrolling, and more customization options.

There’s also a hidden easter egg somewhere in the menus 👀

Image Gallery

Download

u/spiderman2082 — 4 days ago

How do I hold down one key while "auto clicking" a different key

I'm trying to setup a macro so that in a racing game I can hold down the "gas" key while I periodically input a direction key. The "auto clicker" I figured out pretty quickly myself but holding down a key press is proving to be difficult for me to do. Testing in notepad is resulting in a single key press instead of my expected hold down function

reddit.com
u/Valderhide — 3 days ago

Looking for an AHK script to change brightness with an elegant Windows 11 style OSD flyout

Hey everyone,

I'm looking for a lightweight AutoHotkey v1 (or v2) script that lets me control my screen brightness using keyboard shortcuts, but with a catch: I want it to display a clean, modern Windows 11 style OSD flyout.

I guess Microsoft changed the way the native flyouts work in recent Windows 11 updates, making it tough to hook into the default system overlay. Because of that, a standalone overlay rendered directly through the script would be perfect.

Does anyone have a working AHK script that pulls this off? Any help or links to existing scripts would be greatly appreciated!

Thanks!

reddit.com
u/aragonsi26 — 5 days ago

How to bypass "office key" when mapping capslock to hyperkey without admin?

I mapped capslock to hyperkey and everything was working fine until I clicked caps+d which opened up onedrive for some reason. How do I get it to stop working as the office key?

This is my script:

#Requires AutoHotkey v2.0

Hyper(key) {
    Send("{RCtrl down}{RShift down}{RAlt down}{RWin down}" key "{Blind}{vk07}{RWin up}{RAlt up}{RShift up}{RCtrl up}")
}

CapsLock::Send("{Esc}")

CapsLock & a::Hyper("a")
CapsLock & b::Hyper("b")
CapsLock & c::Hyper("c")
CapsLock & d::Hyper("d")
CapsLock & e::Hyper("e")
CapsLock & f::Hyper("f")
CapsLock & g::Hyper("g")
CapsLock & h::Hyper("h")
CapsLock & i::Hyper("i")
CapsLock & j::Hyper("j")
CapsLock & k::Hyper("k")
CapsLock & l::Hyper("l")
CapsLock & m::Hyper("m")
CapsLock & n::Hyper("n")
CapsLock & o::Hyper("o")
CapsLock & p::Hyper("p")
CapsLock & q::Hyper("q")
CapsLock & r::Hyper("r")
CapsLock & s::Hyper("s")
CapsLock & t::Hyper("t")
CapsLock & u::Hyper("u")
CapsLock & v::Hyper("v")
CapsLock & w::Hyper("w")
CapsLock & x::Hyper("x")
CapsLock & y::Hyper("y")
CapsLock & z::Hyper("z")

+CapsLock::CapsLock
reddit.com
u/Prior_Shopping_1911 — 5 days ago

Modify taskbar shortcut context menu?

Hi again... would it be possible after creating, then compiling a script, adding a shortcut to it on my Win11 taskbar... to add entries to its context menu? Or make right/ middle-clicking on the icon do different things?

reddit.com
u/PENchanter22 — 6 days ago

Made a tool that OCRs anything on your screen with a hotkey because I got tired of pasting slides into ChatGPT

I'm a student and kept having to screenshot my lecture slides, open ChatGPT, paste them in just to copy the text. Got annoying so I made this.

Press Ctrl+Shift+T, drag over whatever, text is on your clipboard. Works on slides, PDFs, images, anything rendered on screen. Runs fully locally :)

One-line setup: .\setup.ps1
https://github.com/Hokondrak/snip-transcribe.git

Might be useful if you're in the same situation.

reddit.com
u/op_theUsername — 6 days ago

Coordinates keep changing need help

This is my script. Everytime i restart my script no longer works and I have to adjust the targets. I am using two screens. Is there anyone who can help?

CoordMode, Mouse, Client

Numpad0::

{

`send, {F1}`

	`targetX := 1830`

	`targetY := 870`

`mouseMove targetX, targetY, 0`

`click` 

return

}

Mbutton::

{

`send, {F1}`

	`targetX := 1830`

	`targetY := 870`

`mouseMove targetX, targetY, 0`

`click` 

return

}

reddit.com
u/TestTrenSdrol — 7 days ago

Smart way to replace the "#" StartMenu with PowerToys Command

Hello there,

since I use the Windows StartMenu basically just as programm quicklauncher. Like this
Me typing:
{Win Key} Pai ... (waiting for Paint.exe to be suggested) ... {enter}

I want to switch to Microsofts PowerToys Command Pallete
(I would add a screenshot here, but the sub wont allow it :/ )

Which is a quick launcher.

The problem I'm having is how I can implement this with AHK.

PowerToys won't allow just #
So I was thinking along the lines of
LWin Up::Send "#+{F21}"

But that will overlap with existing Hotkeys that already exist prebaked in Windows like #+s for Screenshot Tool


The only thing I can think of is rewriting all Windows Hotkeys into AHK, so I can then manage it all via AHK. Any suggestions?

reddit.com
u/MachineVisionNewbie — 7 days ago

I want sticky keys to exclude the Windows key

I want sticky keys enabled but only for Ctrl and Shift keys, not the Windows key. Can this be achieved through AHK?

reddit.com
u/techyall — 9 days ago

Open source script that can summarize highlighted text from any application for you.

Hello! Have you ever wanted to summarize textbooks on chrome without getting an annoying paid extension, or summarize a word document without using copilot?

I may have invented a script entirely from vibe-coding that uses an API to summarize highlighted text for you by just pressing CTRL+ALT+S.

Now, im not lying saying that I vibe coded this. I literally did. I wanna hand the code off to people who actually know Auto Hotkey much more than I do so they can fix/add onto this piece of code.

I haven't seen anyone make a tool like this before, to where it summarizes text no matter what app you use. It might end up really good for those who put the care into adding new features and a cool GUI to it.

I have made it so it supports both Claude API's and OpenAI API's.

Seriously, don't harass me for vibe-coding this. I know it sucks and I didn't learn anything. But the idea just came to mind and I had to make it right away without having to dive so much into learning auto hotkey (to be honest, just doing this kinda makes me want to learn it in depth).

I did make a video showing how to use it, but sadly I can't upload it on here for some reason so here is an unlisted youtube link to it: https://www.youtube.com/watch?v=pOV5FrvCzhQ

Now, there are some changes added to it after the video was made. I made it so that way you have a bar above the window for moving the window around and exiting, as well as support for OpenAI API's. (I know I said I was gonna do all of them but its too much of a pain in the but for me, I had enough vibecoding)

So yeah, do whatever you want with it! I will link the ZIP file in the github page here: https://github.com/denver2941/Summarizer

u/Alternative-Ad-560 — 9 days ago

I CANNOT seem to get the AutoHotKeys to run on start up!

I've been going through this reddit and looking at videos online and following all of the tips and AutoHotKey just wont run on start up.

I've got a folder in C: Scripts with all of my AHK file. I make a shortcut and then place the shorcut in Shell:Startup and then I restart and it just doesn't run.

How can I make it where my AHKs all run on Start up? Am I missing a step?

reddit.com
u/AHungerForKnowledge — 9 days ago

Left/right-alt specific hotkeys started requiring double press when Outlook is open

Just recently--most likely with a Outlook (Classic) update--my ALT hotkeys started requiring double press in quick succession to work. I have never seen anything like this before. CTRL hotkeys still work fine.

I've tried:

  • Using ALT & key rather !key to define the shortcut
  • Prepending $
  • A_MenuMaskKey := "vkE8"

Any suggestions for how to further troubleshoot?

I'm on Outlook 365 Version 2606 (20105.200000 Click-to-Run), Windows 11 25H2 (26200.8246).


Figured it out! It turns out it wasn't an Outlook update, but rather a PowerToys update. If I disable the PowerToys Grab and Move utility, my alt shortcuts work again. So now the question is whether there is any way for AHK to intercept alt keybindings and not be edged out by this PowerToy, or if I just need to disable the PowerToy.

u/Proud_Championship36 — 11 days ago

Why v1: Genuinely Curious

Quite often here lately, I’ve seen people post a script or ask for help, and they’re using AHK v1.

AHKv2 has been the stable release for a while now. The syntax is cleaner, it’s more consistent, and it’s clearly the future of the language. It’s quite a bit better.

Why would you choose to learn the older version from scratch (especially given the brain-melting syntax, as u/Keeyra_ put it)? For me, I’ll admit that I’m locked in to v1 for my work, so there’s that. But I’ve switched to v2 for everything else.

Is it outdated tutorials? Misleading search results pointing to old docs? Path dependency? Locked in for some reason? Genuinely curious what’s driving this.

reddit.com
u/xyzzy0 — 13 days ago

I'm spending so much and getting so little out of this app.

I tried so many different scripts, and I'm getting disappointed every time. Let alone the larger projects, I can't even get these small scripts to work...

Problem 1: I want to pause the video in VLC after 5 seconds:

HotIfWinActive "ahk_class Qt5QWindowIcon" 
^SPACE:: 
Sleep 5000 
Send "SPACE"

getting this error message: "HotIfWinActive "ahk_class Qt5QWindowIcon", this line does not contain a recognise action.

Problem 2: this hotkey stays activated even when I am not using the specified apps

HotIfWinActive "ahk_class Chrome_WidgetWin_1"
HotIfWinActive "ahk_class Qt691QWindowIcon"

XButton1::Backspace 

Thank you in advance for you help, I am out of my wits.

reddit.com
u/hmmmmga — 12 days ago

Keyjoypad using keyboard's keypad tested on video youtube

I created a simple accessibility script that grants you mouse usina any keyboard's keypad, I used it in Live Gameplay, you can find it in my youtube channel linked in my profile. The script is on github open-source for non profit use.

reddit.com
u/BackedLotus — 12 days ago

All the QoL hotkeys I use all the time! (Opinions pls)

(Script in comments)

I'm not a programmer, but I like shortcuts more than I probably should. My friend GPT helped me with all the commands and I organized them into a pocket-sized toolkit.

I use a laptop without a mouse most of the time, so these little shortcuts make my life a little less lifeless.

; Is there any point in sharing this with the experts?...

reddit.com
u/Moccine — 13 days ago