The issue you're experiencing with the AutoHotkey (AHK) script is likely due to how context-sensitive hotkeys are being defined. Specifically, using GetKeyState within #If statements can sometimes lead to results that are not as expected, particularly for modifier keys like Alt.
<^ and ! Modifiers: In the AHK script, the <^> modifier indicates AltGr or Right Alt (RAlt), and ! is used to specify the Alt key. By combining them, you create a hotkey that specifically triggers when both keys are pressed.
Direct Hotkey Mapping: Instead of using #If with GetKeyState, directly map the combination using the modifiers. This ensures the script listens for the exact combination you're interested in.
Avoid #If With GetKeyState for Modifiers: Using #If along with GetKeyState can sometimes be unreliable for detecting immediate states of modifier keys, which is why directly defining the combination is a more robust solution.
pls read more about it from here: https://impetusorgansseparation.com/avnneqwn?key=670ae0c3b093d8e8ac42c57aa7da8c14