Search code examples
autohotkey

Square key is not working anymore in Autohotkey


I have been using these hotkeys for a while now

        ² & WheelDown::AltTab ;; <-- AltTab with mouse
        ² & WheelUp::ShiftAltTab ;; <-- AltTab with mouse

Since last monday it is not working anymore and I have this message raising up

enter image description here

I have no idea how to fix it. Any idea ?


Solution

  • I think it is because you are saving the ahk script as Unicode. AHK only parses ASCII.

    Open your script in Microsoft Notepad, and "save-as" under Encoding: select "ANSI"

    I tested your code, and I get a different error about not having the ² key in my keyboard layout when saving as ANSI. I get the same error when I save it as UTF-8

    Upon testing a custom keyboard layout, I am able to use the script with no error after saving the ahk file as type ANSI, having remapped my 2 key to ²


    UTF-8:

    image of AHK error with UTF-8 Encoding indicating invalid hotkey


    ANSI:

    image of AHK error with ANSI Encoding indicating ² key doesn't exist in keyboard layout