Can You Get the Cadence Zoom with RMB Click-and-Drag in S-Edit? (YES)


Script that used to work 10 years ago no longer does, but, thankfully, chatGPT is on hand to deliver. How do these geniuses do it?

Works :

#IfWinActive, S-Edit


; Make mouse coords consistent with ControlClick/Click

CoordMode, Mouse, Client


; Optional: make sending snappier

SetKeyDelay, -1

SetMouseDelay, -1


RButton::

{

    MouseGetPos, sx, sy


    ; Wait a short moment to see if this becomes a drag

    Loop

    {

        Sleep, 20

        MouseGetPos, cx, cy


        ; If RMB released before dragging => treat as normal right click

        if (!GetKeyState("RButton","P"))

        {

            Click, Right

            return

        }


        ; Drag threshold

        if (Abs(cx - sx) > 5 || Abs(cy - sy) > 5)

        {

            ; Enter zoom mode (your S-Edit hotkey)

            SendInput, z


            ; Press-and-hold LEFT at the starting point (client coords)

            ; Using Click here is often more reliable than ControlClick for drag gestures.

            Click, %sx%, %sy%, Left, Down


            ; Hold until RMB released, then release left

            KeyWait, RButton

            Click, Left, Up

            return

        }

    }

}

#IfWinActive


Old one that no longer works (kind of works 1/4 of the time):

#IfWinActive, S-Edit

    RButton::

     MouseGetPos, sx, sy

     If ( GetKeyState( "RButton", "P"))

     {

        Loop{

            Sleep, 50

            MouseGetPos, cx, cy

            If ( abs( cx-sx) > 5 or abs( cy-sy) > 5 )

            {

                Send z

                ControlClick, X%sx% Y%sy%,,,,,D

                Break

            }

            If ( !GetKeyState("RButton", "P") )

            {

                Click Right

                return

            }

        }

        KeyWait, RButton

        Click Up

        return

     } else {

        Click Right

        return

     }

    return

#IfWinActive ; S-Edit

Comments

Popular posts from this blog

Don't Miss Out. Start Using the Find Navigator Today

Are You a Tanner Power User?