u/TheThousandMiafo

Made my own Canvas Rotate Tool since Affinity seems to not be implementing it any time soon

I'm not a programmer but with the help of Claud I managed to pull off a decently working script with AutoHotKey. Works both for mouse and pen users with graphic tablets, just press R and drag.

Just need to have AHK installed and to not have any hotkey mapped to "R" in Affinity.

Would love if anyone has a better solution!

#Requires AutoHotkey v2.0
#HotIf WinActive("ahk_exe Affinity.exe")

R:: {
    MouseGetPos(&centerX, &centerY)
    prevX := centerX

    while GetKeyState("R", "P") {
        MouseGetPos(&curX, &curY)
        moved := curX - prevX
        prevX := curX

        if (moved > 1) {
            DllCall("SetCursorPos", "int", centerX, "int", centerY)
            Send "{Alt Down}{WheelDown}{WheelDown}{Alt Up}"
            DllCall("SetCursorPos", "int", curX, "int", curY)
        } else if (moved < -1) {
            DllCall("SetCursorPos", "int", centerX, "int", centerY)
            Send "{Alt Down}{WheelUp}{WheelUp}{Alt Up}"
            DllCall("SetCursorPos", "int", curX, "int", curY)
        }

        Sleep 10
    }
    Send "{Alt Up}"
}

#HotIf
reddit.com
u/TheThousandMiafo — 1 day ago