Jump to content

MouseCoordMode "Issues"


Go to solution Solved by ioa747,

Recommended Posts

Posted

Ok!

Let me see if I have "got" this?

Local $oldMode = Opt("MouseCoordMode", 0)
; Here $oldMode = 1, because, as noted, 1 is the the value of the previous setting for the option...Correct?

Local $oldMode = Opt("MouseCoordMode", 0)
; Here the value of $oldMode is 0, because of the Local declaration...Correct?

Opt("MouseCoordMode", $oldMode)
; Here the value of $oldMode is 1, because, again, as noted, 1 is the the value of the previous setting for the option...Correct?
Posted (edited)

Actual
Position: 0, 0
Size: 1920 x 1080

With SAC launched:
Position: -3, -3
Size: 1926, 1086

My "shell" script:

; -----------------------------------------------
; 4/18/2026 9:28:41 AM
; -----------------------------------------------
Opt("MustDeclareVars", 1)
Opt("MouseCoordMode", 1) ; Not really requried as the default Mode is 1
; -----------------------------------------------
LaunchRMLFunc()
; -----------------------------------------------
Func LaunchRMLFunc()
    Local $oldMode = Opt("MouseCoordMode", 0)
    ConsoleWrite($oldMode & @CRLF)
    ConsoleWrite("Displays the previous value of $oldMode - which is 1" & @CRLF)
    ; Insert Locals here.
    ConsoleWrite(Opt("MouseCoordMode") & @CRLF)
    ConsoleWrite("Displays the new value of $oldMode - which is 0" & @CRLF)
; -----------------------------------------------
    ; Insert RML function here!
; -----------------------------------------------
    Opt("MouseCoordMode", $oldMode)
    ConsoleWrite(Opt("MouseCoordMode") & @CRLF)
    ConsoleWrite("Displays the original value of $oldMode - which is 1" & @CRLF)
EndFunc   ;==>LaunchSAC
; -----------------------------------------------

Update!
The "previous example" you provided, ioa747...is working out just great! Thanks for this!

Edited by mr-es335
Posted

 

; -----------------------------------------------
Opt("MustDeclareVars", 1)
Opt("MouseCoordMode", 1)

Global $iTimeOut = 4000

LaunchTest()

ConsoleWrite(">>-->> At the end I have MouseCoordMode: " & Opt("MouseCoordMode") & @CRLF)


; -----------------------------------------------
Func LaunchTest()
    Local $sMsg
    MouseMove(20, 20, 20)
    $sMsg = "-> This is a (20, 20) position with MouseCoordMode: " & Opt("MouseCoordMode")
    ConsoleWrite($sMsg & @CRLF)
    ToolTip($sMsg, Default, Default, "", 0, 1)
    Sleep($iTimeOut)
    ToolTip("")

    Local $hScite = WinActivate("[CLASS:SciTEWindow]")
    ConsoleWrite("$hScite=" & $hScite & @CRLF)
    WinWaitActive($hScite, "", 3)

    If $hScite Then
        Local $oldMode = Opt("MouseCoordMode")
        Opt("MouseCoordMode", 0)

        MouseMove(20, 20, 20)
        $sMsg = "-> This is a (20, 20) position with MouseCoordMode: " & Opt("MouseCoordMode") & " relativ to Scite"
        ConsoleWrite($sMsg & @CRLF)
        ToolTip($sMsg, Default, Default, "", 0, 1)
        Sleep($iTimeOut)
        ToolTip("")


        Send("^f") ; Ctrl + F
        Local $hFind = WinWait("[CLASS:#32770; TITLE:Find]", "", 3)
        ConsoleWrite("$hFind=" & $hFind & @CRLF)
        WinActivate($hFind)
        WinWaitActive($hFind, 3)

        If $hFind Then
            MouseMove(20, 20, 20)
            $sMsg = "-> This is a (20, 20) position with MouseCoordMode: " & Opt("MouseCoordMode") & " relativ to Find"
            ConsoleWrite($sMsg & @CRLF)
            ToolTip($sMsg, Default, Default, "", 0, 1)
            Sleep($iTimeOut)
            ToolTip("")
            ControlClick($hFind, "", "Cancel")
        EndIf

        Opt("MouseCoordMode", $oldMode)
    EndIf

EndFunc   ;==>LaunchTest
; -----------------------------------------------

 

I know that I know nothing

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...