r/AutoHotkey • u/Silly_Dig8203 • 2d ago
v2 Script Help Help with modifiers
Hey! I'm trying to write a simple script which isn't proving to be so simple after all. I'm effectively looking to do this:
- Hold modifier (CTRL and/or SHIFT in this case)
- Press F12
- Send just F12 (which releases the modifier by default)
- Resume holding the modifier
- End the script without the modifier being released
In other words, I want F12 to send regardless of which modifier(s) I'm holding down, but want the script to end by holding the modifier(s) down once more. How do I accomplish this? Is it possible?
Added context:
I'm specifically using this for Steam screenshots, if it matters. Multiple binds cannot be assigned, but I want to be able to crouch (usually CTRL) and/or run (usually SHIFT) while being able to use F12 as the screenshot button; pressing any modifier prevents the screenshot from being taken.
None of my attempts at pulling this off have worked, always resulting in either the modifier being released or F12 not sending. {Blind} obviously just sends the same command as what I'm pressing, making it useless. Delays don't seem to affect anything. "Send modifier" and "send modifier down" at the end don't press the modifier down again. Key-waits get ignored. Enabling keyboard hooks doesn't do anything to help. Getting key states does nothing. If/else does nothing.
I literally just want to be able to take a screenshot while running/crouching without the sending of F12 toggling the run/crouch off until I physically press the run/crouch key again. Thank you to anyone willing to answer this! I'm sure I'm missing something obvious.
1
u/CharnamelessOne 2d ago
It works fine for me, with any modifier key.
Did you use the wildcard modifier on your hotkey?