r/AutoHotkey

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 — 18 hours 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 — 3 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 — 21 hours 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 — 5 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 — 1 day 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 — 4 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 — 4 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 — 5 days ago

[My keyboard model](https://www.amazon.com.au/dp/B0BHR39N8Z)

In the top right corner are select all, copy, paste and cut keys that I never press. I do not want to change what keys trigger copy etc.

I want to find their key identifiers (?) numbers (?), so I can use things like autohotkey to change their function.

I've tried "what key am I pressing" but it just reads as if I pressed ctrl then V in sequence

In powertoys remap a key, entering the key to select it just gets C/V/A etc.

There's a ton of unknown key names like "VK #". How would I go about finding the right ones if applicable

reddit.com
u/Yggdrasilo — 9 days ago

Now that using Windows has gotten so horrible I'm not sure what to do.

I will never infect my computer with Win11. In the month of April, automatic updates to Win10 have gotten so numerous it's getting hard to use with all the warnings from my update blocking script. At last count I was getting around forty popups per day.

No, Microcrap is not suppose to be sending out Win10 updates anymore but they are working hard to do it. Those updates are not actually updates, but designed to degrade Win10 to the point it's nearly unusable. Some of the components downloaded with the "Updates" are actually tools to uninstall non-microsucks software. I've seen the tools in the download folder with my own eyes, so it's not just tinfoil hat, deep conspiracy Youtube channel rhetoric.

So now I'm at the point I need to make a drastic decision.

  1. Switch to Linux without an AHK option. 20+ years of AHK scripts I use every day will be useless.
  2. Allow Windows to downgrade but keep using my AHK scripts, that is if Microshit doesn't uninstall AHK.
  3. Set the Upgrade Blocking script to work in the background. Which would mean blocking updates for all the software I use.
  4. Using my PC as is with either windows downgrading to nearly unusable or pop ups making it nearly unusable.

I'm making one last attempt at finding an AHK alternative for Linux. Even though I've been actively looking for over a year, maybe there's an AHK alternative I have just missed. I've only discovered a couple being ported for Linux but they seem to be far from being usable as of yet.

Keysharp is the one that looks like the best option but it still isn't ready. There was one other that looked promising but now I can't find it again. Here's hoping something else exist.

Edit, the one I couldn't remember is Autokey. I would like to give this one a try but for my life I can't figure out how to install it.

reddit.com
u/X320032 — 12 days ago

Custom autohokey version switcher

Hey big dudes, i'm in closed into user-scope. Using the business workstation, limited access of device Administrator. I have multiple ahk scripts (v1,v1_h,v2,v2_h,v2.1) but every time i need set manually Autohotkey.exe path ( Open With -> Choose Another App ) then choose correct version of the script.

h mean https://hotkeyit.github.io/v2/

There is a way without use Autohotkey V2 switcher? By the way on my PC, this works #Requires AutoHotkey v2.0 but there is other problem when the script use v1_h or v2_h versions, #Requires not work for that.

reddit.com
u/iuriimattos2 — 3 days ago

Hi everyone, total newbie here

I initially installed AHK because I wanted to bypass some hardcoded keybinds in TES IV Oblivion.

I've succeeded making the remaps I wanted, but I realized there was no "Toggle sprint" option in the game, only "Hold".

So here I am trying to write a little script to make toggling possible, but I encountered a small problem.

What I want, basically, is that whenever I press the wheel button on my mouse, my character keeps sprinting without having to hold said wheel button.

I came accross this script which I adapted to my needs :

MButton::

{

static Toggle := 0

click( "{" ( toggle := !toggle ? "MButton down" : "MButton up" ) "}" )

}

Now, here's the problem : when I run the script, the first time I press the button, it works as intended. When I click a second time, it stops as intended.

But when I try to click a 3rd time, nothing's happening anymore !

I'm totally lost. I've tried resolving this on my own but with no success, so I hope some of you guys will be able to help ^^'

(ps: sorry for my english if there's any grammar mistakes)

reddit.com
u/-b-a-s-i-l- — 7 days ago

I was actually able to create a similar script to this that types parentheses instead of quotations:

!9::

Send, ()

Send {Left}

#NoTrayIcon

I have never been able to figure out how to do this with quotation marks, any ideas?

thanks in advance!

reddit.com
u/fuckAraZobayan — 9 days ago

I have this line to rebind control to alt because my control key doesn't work.

LAlt::LCtrl

It seems to work in other contexts except Starcraft 2. The game does register my alt presses as ctrl. The problem is when I tried to change my keybindings in the settings, it couldn't bind combinations of alt + another key. Normally in sc2 you would be able to bind combinations with modifier keys (shift, ctrl, alt).

The problem seems to be that now my alt key (which is bound to be Ctrl) only sends a signal on release. I tested this with online keyboard testers and I seem to be correct. So I need a way to make it so that it also sends a signal while it's pressed down or something like that.

Btw I also have this line to make AltTab work.

<!Tab::AltTab

No idea what that means. Holding down alt works when I'm alt tabbing, so that's weird.

reddit.com
u/Vylez — 7 days ago

Repo + install: https://github.com/cushycush/wflow (stars help with discovery on the awesome-lists if it's your kind of thing)

Long-time AHK lurker, mostly. The shape of "press a chord, fire a script" is the move I miss most when I'm on my Linux machine. xdotool

  • a compositor bind sort of works, but xdotool doesn't run on Wayland, the workflow file is split across three different config files, and text expansion is a different tool entirely.

So I built wflow. It's not AHK. It's not as old, the language isn't as deep, and the Windows-side IME / window-class feature set isn't the same. But on Linux specifically, on Wayland specifically, it's the piece I wanted:

  • Bind ctrl+alt+t (or any chord your compositor will let go of) to a multi-step workflow
  • Steps include shell, key, type, focus, wait, repeat, and conditionals. Same shape as Send, Run, WinActivate, if/else.
  • All in one plain-text file per workflow. Diff it, version it, share it.
  • A GUI editor for the people who don't want to hand-write the file, including a step-by-step debugger that pauses between actions.
  • A daemon that probes the right backend at startup (GlobalShortcuts portal on Plasma 6 / GNOME 46+, IPC on Hyprland and Sway).

AHK example, your daily standup:

::stand::
Run, slack
WinActivate, Slack
Send, ^k
SendInput, #standup-platform
Send, {Enter}
return

Same workflow as a .kdl file:

workflow "Morning standup" {
    trigger {
        hotstring ";stand"
    }

    shell "hyprctl dispatch exec 'slack'"
    wait-window "Slack" timeout="20s"
    focus "Slack"
    key "ctrl+k" clear-modifiers=#true
    type "#standup-platform"
    key "Return"
}

I'd love AHK people to roast it. I'm aware of how thin the language is compared to AHK v2 right now (no expression-level scripting, no real string functions, no array primitives). The deliberate trade is that the file format is also the file you ship to other people, so I kept the surface small. There's an include mechanism for shared fragments, and shell plus repeat plus conditionals get you to the same place AHK control flow does for most chord shortcuts I see in the sub. But yes, the gap is real.

If you want to try it: wflows.io for the catalog, github.com/cushycush/wflow for the source. I'd rather hear "this fails on the workflow I actually wanted to port" than fluffy applause, so feel free to break it.

u/DaCush — 10 days ago

I have the following AHK v2 (2.0.26) script that allows me to if Caps lock or Left Windows Key is on to instead of default Mouse Wheel Scroll down,
Send Right Key to fast forward youtube.

#Requires AutoHotkey v2.0
Persistent()  
#SingleInstance Force 
SendMode "Input"
A_MaxHotkeysPerInterval := 500 
A_HotkeyInterval := 2000

~LWin::{
    Send "{Blind}{VKFF}" ;prevent LWin on its own
}

#HotIf !GetKeyState("CapsLock", "T") &amp;&amp; !GetKeyState("LShift", "P") &amp;&amp; GetKeyState("LWin", "P")
&lt;#WheelDown::  {  
    Send("{Right}")
}
#HotIf

#HotIf GetKeyState("CapsLock", "T") &amp;&amp; !GetKeyState("LShift", "P") &amp;&amp; !GetKeyState("LWin", "P")
WheelDown:: {  
    Send("{Right}")
}
#HotIf

However the Left Windows Hold button does not suppress the Windows key always and the Windows Start menu pops up when going forward (around the 5th scroll) despite it being suppressed in AHK and working for the first scroll down. This is despite it being EXPLICITLY set to never show even if Windows button is pressed on its own.

I guess the problem is due to rapid number of keys being fired when scrolling. This happens when the Windows button is not depressed but key up all the time without changing.

I have added suppression on the Up press too but this doesn't change the symptoms

~LWin Up::{
    ;WindowsFunctions.PreventOpenStartMenu()
     Send "{Blind}{VKFF}"
}~LWin Up::{
    ;WindowsFunctions.PreventOpenStartMenu()
     Send "{Blind}{VKFF}"
}

When holding Win button and right arrow press multiple times the Start Menu suddenly appears when Mouse wheel scrolling down.

What I believe is related to solving the problem is the A_MaxHotkeysPerInterval setting. I am forced to use it as otherwise I get a warning of

"71 hotkeys have been received in the last 1562ms. Do you want to continue? (see A_MaxHotkeysPerInterval in the help file)

So it seems without A_MaxHotkeysPerInterval I get the YesNo option but with the script acts inconsistent when reaching many hotkeys e.g. 71 hotkeys in 1.5 seconds.
I have a free wheel scroll mouse which explains the large number of events per second.

I played around with A_MaxHotkeysPerInterval and A_HotkeyInterval these but this doesn't make much a difference what I set it to. Almost as if there is hardcode limit for A_MaxHotkeysPerInterval so the value I set doesn't matter.

I have another test where I use CAPS lock for fast forward. Since it doesn't use Windows key it doesn't have the Start Menu problem. However it sometimes instead of sending the right arrow sends a normal wheel down. This is strange since it means the simple code of

#HotIf GetKeyState("CapsLock", "T") &amp;&amp; !GetKeyState("LShift", "P") &amp;&amp; !GetKeyState("LWin", "P")
WheelDown:: {  
Send("{Right}")
}
#HotIf

Can fail and revert to default behavior.

reddit.com
u/gidmix — 8 days ago

Fork of - windows-desktop-switcher
Git repo - WinHypr-Switcher

Why I build this?
I am so use to Hyprland window management on Linux and wanted something "KeyBoard Driven" and Quick Less Bloated method to switch desktop (workspaces)

Why didnt I used Glazewm or other window manager?
Cuz I find them Clunky and Cpu/Ram hungry and they run on top of
Desktop Window Manager
So instead we can just get Hyprland's Keyboard driven setup + existing Windows WM
Its an attempt to make windows 11 better without needing for a wm on top

Its SUPID FREE //no offence
&gt; I mean you will have no permission issue Setting this up or uninstalling it
There are simple script that you can run via POWERSHELL or NUSHELL
Also there is a nuke.ps1 //trust me its safe
its only job is to clean up the folder (after user uninstall it)
Pure CLI

Thanks for reading :3 //first time posting here as linux user

u/dashinyou69 — 7 days ago

I use a presentation software (Proclaim, if anyone is actually familiar with it) that allows me to toggle a quick slide and the active slide. For instance, I could put up the company logo while the speaker is elaborating and put up the quote he is reading from when he is actively reading. The native key to put up the logo is F11, F12 returns me to the most recent active slide. Almost all the keys I use are in easy reach of the arrow keys, except these. I would like to consolidate the motion. Since Up is the same as Left and Down is the same as Right, they are redundant - So I would like to map Up to be F11 and Down to be F12 (put up logo, take down logo).

I tried a variety of things already for the most basic

::Down::F11

then

::{Down}::{F11}

then

::{Down}::Send {F11} ;And also without the brackets

I get one of two errors each time:

  1. It gets mad because I have a bracket where I am not supposed to

  2. "Expected string but received Function instead"

My gut is telling me that either arrow keys cannot be remapped, or that I cannot map to an F key. But I haven't found anything saying that save this thread which seems to have conflicting opinions and several other threads seem reach the consensus that you can indeed map to an F key. Thus far, I haven't found anyone trying to make Arrows do anything special, so that is my current theory as to the issue, but I figured I would ask before giving up entirely.

reddit.com
u/Feeling_Squash7137 — 10 days ago

Sendtext sending gibberish

SOLVED: Probably been said many times before, but don't test your scripts in Notepad!

Hey folks,

I'm trying to write a simple script to automate some of the phrases I have to type at work. My script is painfully simple but doesn't work:

F13::
{
SendText "Alt HW ist im EGS angekommen."
}

But when I activate and test it, I get errors, it might work once or twice out of ten times:

Alt HW ist im EGS angekommen.

Alt HW ist im EGS angekommen.

Alt GS angekommen.

Alt HW ngekommen.

Alt HW ist im ekommen.

Alt HW gekommen.

Alt HW ………..

Alt …………….

Alt gekommen.

Alt …………………….

Has anyone had this problem before, and can you tell me what I've done wrong?

reddit.com
u/Renoized — 6 days ago

I have 3 different user accounts that I'll use depending on what I'm doing. I'm lazy and typing usernames is hard, so I have an AHK script setup to type out each of them for me. I mostly use this for RDP. This is never worked on UAC popups when trying to run something as admin, but I've learnt to live with that. Using it for RDP was where it was most useful.

The script is pretty simple, but it's worked well for me for the past few years. Ctrl + Shift + F1/F2/F3 will type each of the usernames for me.

^+F1::

sendraw Username_1

return

^+F2::

sendraw Username_2

return

^+F3::

sendraw Username_3

return

I was given a new work laptop this week and copied all my AHK scripts over and re-installed AHK (v1.1.37.02). Everything else is working as expected, but for some reason, now I cant use me username script to type my usernames into RDP login windows. It's just not typing anything. It will type out my usernames into Notepad without any problems.

And I've tried changing from SendRaw to Send, SendEvent, SendInput, and SendPlay with no success.

Anyone have any ideas as to what might be causing this to no longer work the way it used to?

Unfortunately I cant go back to my old laptop to see what version of AHK it was running, it's already been wiped.

TIA

reddit.com
u/SmugMonkey — 13 days ago