Instant Spell Switching AHK Macro Script
⚪ Last updated 2023⚠️ Install Order · 1 step
Install in this order, then this mod last — most mods fail to load without their framework and dependencies in place.
Preview

🔍 Analysis
- 👍 2.5% endorsement rate — high engagement, a strong quality signal
- 🏆 #132 of 259 Gameplay mods in this game by downloads
📋 About This Mod
Normally you have to press F2(or cycle up/down) then 1 to cast Spell 1 in your Spell Set 2 and then you have to press F1 then 1 to cast Spell 1
in your Spell Set 1 again.
This script makes it so you can just press ` to cast Spell 1 in your Spell Set 2 and press 1 to cast Spell 1
in your Spell Set 1 without ever pressing F1 or F2 or cycling up and
down with your scroll wheel.
Instead of two keypresses it is now condensed into one keypress.
Rebind Revelio and the Spell Selection keys in-game, and it also requires 2 extra mouse buttons but you can rebind them all to something else if you want.
Extra Mouse Button 1(Back) = F3+3
Extra Mouse Button 2(Forward) = F3+4
To rebind:
Install AHK, I use v1 not v2.
Edit/open the .ahk script with notepad
1:: ; this is the key that you will press, for this instance this is a macro to cast your first spell in spell set 1
Send, {F1} ; spell set 1 key
Sleep, 10 ; 10 millisecond delay before pressing {1}
Send, {1} ; cast spell 1 key
For AZERTY or any other keyboard layout you have to use the scan codes:
² = ` = SC029
& = 1 = SC002
é = 2 = SC003
" = 3 = SC004
' = 4 = SC005
( = 5 = SC006
- = 6 = SC007
è = 7 = SC008
Example Spell Layouts
My current personal layout:
Color coded spell sets:
U-P17LEie6E
SM_J6LcFwK4
ppFeot2lTGg
y9DkcfmW5Hc
Full Script
#IfWinActive ahk_exe HogwartsLegacy.exe
XButton1::
XButton2::
This AutoHotkey script assigns 16 hotkeys to all 16 spell slots in the game, letting you cast any spell with a single keypress instead of using the spell set button plus 1/2/3/4. It's a simple utility for players who want faster spell switching. With 101 endorsements and 4,034 downloads, it has a modest but active user base.
✨ Key Features
📊 Pros & Cons
✅ Pros
- Saves precious seconds in combat—no more fumbling with spell set combos.
- Community-tested with 101 endorsements and over 4,000 downloads.
- Lightweight and simple; doesn't bloat your game with heavy mods.
⚠️ Cons
- Requires AutoHotkey installed and running—extra setup outside the game.
- No instructions included in the description; you'll need to figure out keybindings yourself.
- Last updated in 2023—might not work with future game patches.
For players who want faster spell casting and are comfortable running AHK scripts. If you're a purist who prefers vanilla controls, skip it. Also great for players with many spells who want to reduce button mashing.
💡 Beginner Tips
- Make sure AutoHotkey is installed and running before launching the game.
- Test the hotkeys in a safe area to avoid accidental spell casts during combat.
- If you're not sure which hotkeys are assigned, check the script file to see the default bindings.
📊 Mod Details
- Game
- Hogwarts Legacy Mods
- Author
- Micchannn
- Version
- v1.2
- Downloads
- 4,034
- Endorsements
- 101
- Category
- Gameplay
- Created
- 2/10/2023
- Updated
- 2/12/2023
🔧 How to Install Hogwarts Legacy Mods
Download from Nexus.
📖 Full step-by-step install guide for Hogwarts Legacy →
Visit the official mod page for specific installation instructions for this mod.
🎮 Need cheat codes or console commands? Check ur gaming wiki for Hogwarts Legacy commands, item IDs, and more.
Keep browsing — more Hogwarts Legacy mods await