For windows only autohotkey script to remap middle mouse and right mouse for MNodes v1.6

This autohotkey script switches functionality for Right Mouse and Middle Mouse on windows for MNodes

This script is just a different way of navigating mnodes that i personaly prefer because middle mouse button usualy breaks after 2 weeks on any mouse i use and in my fl studio setup where i have 150% menu’s it behaves badly to no fault of mnodes i use very zoomed settings everywhere (windows also at 150%) and this fixes that also for me.

note that it is possible it will act on plugins in perform so just know this is for editing and not use in perform. for this reason you can suspend it using f9 & f10 and exit script with CTRL + ESC. (i should also note that i myself have not found a reason to turn it off in perform but there might be one on your gui i dunno there would be if you implemented right mouse or middle mouse click on it somehow)

Your antivirus is bugging you and you dont trust it? the code is unprotected you can just drag the exe in any text editor to see the code it will be on the bottom after the compiler stuff. Unprotected should also alarm fewer antivirus program who hate autohotkey.

v1.0 created by OctaFuzZ 10 august 2026
v1.6 23 august 2026

what will be different:

  • you can use right mouse to move the map
  • you can use middle mouse or f11 f12 to open the node picker/normal right click options also:
  • F5 F6 F7 F8 on a selected node opens rename
  • F1 opens mnodes online nodes help

quickest workflow is to use middle mouse while a node is selected to bring up the right click menu and when you have nothing selected it will bring up the node picker

v1.6 code

#SingleInstance, Force
#Persistent
#NoEnv
#KeyHistory 0
ListLines,off
SetTitleMatchMode,1
SendMode, Input ; here so that if i want to change it i only have to do it here

; GroupAdd excludes script name and i can quickly add potential other windows later on which might be needed as time progresses
GroupAdd, MNodes, MNodes, , , MNodes Remap Keys


; custom tooltips related
DllCall("SetThreadDpiAwarenessContext", "ptr", -3, "ptr") ; dpi awareness
Global TempTimer
GoSub, StartupToolTip
return ; end startup section


StartupToolTip:
    ShowTooltip("Started","1000","01CDDA","060909","Arial","13","10")
    return


#IfWinActive ahk_group MNodes
F1::
    Run, https://mnodes-docs.marionietoworld.com/nodes/
    return
F5::
F6::
F7::
F8::
    send, ^r
    return
RButton::
	KeyWait, RButton, D
	send, {MButton Down}
	KeyWait, RButton, U
	send, {MButton Up}
	return
F11::
F12::
MButton::
	send, {RButton}
	return
#If

; suspend script
F10::
F9::
	Suspend, Permit ; excludes F10:: F9:: routines from suspend
	Suspend
	If A_IsSuspended = 1
	{
		ShowTooltip("Suspended","700","01CDDA","060909","Arial","13","10")
	}
	If A_IsSuspended = 0
	{
        sleep, 20 ; give a bit of recovery time coming out of suspend before showing enabled
		ShowTooltip("Enabled","700","01CDDA","060909","Arial","13","10")
	}
	return

^ESC:: ; CTRL + SHIFT + ESC = exit script
	ShowTooltip("Closing","1000","01CDDA","060909","Arial","13","10")
	sleep, 1000
	ExitApp
	return


DestroyTooltip:
	Gui, CustomTooltip: Destroy
	SetTimer, CheckMouseOver, off
	return


CheckMouseOver:
    MouseGetPos, , , MouseWinId
    TooltipWinId := WinExist("CustomTooltip")
    if (MouseWinId = TooltipWinId)
    {
        SetTimer, DestroyTooltip, Off
        SetTimer, DestroyTooltip, -%TempTimer%
    }
	return


;;;;;;;;;;;;;;;;;;;; functions below ;;;;;;;;;;;;;;;;;;;;;


; tooltip simulatiion function
ShowTooltip(Text,Timer,TextColor,Background,Font,Size,Radius) {
    Global

    ; get position to place the tooltip
    MouseGetPos, X, Y

    ; destroy old tooltip if exists
    Gui, CustomTooltip: Destroy
    SetTimer, DestroyTooltip, off
    SetTimer, CheckMouseOver, off

    ; copy the timer for use in CheckMouseOver:
    TempTimer:=Timer

    ; create new tooltip
    Gui, CustomTooltip: New
    Gui, CustomTooltip: Margin, 10, 5
    Gui, CustomTooltip: -Caption +ToolWindow +AlwaysOnTop +LastFound
    Gui, CustomTooltip: Color, %Background%
    Gui, CustomTooltip: Font, s%Size% c%TextColor%, %Font%
    Gui, CustomTooltip: Add, Text, gDestroyTooltip, %Text%
    Gui, CustomTooltip: Show, x%x% y%y%, CustomTooltip

    ; get dimensions
    WinGetPos, WinX, WinY, WinWidth, WinHeight, CustomTooltip

    ; monitor under mouse working area detection
    SysGet, MonCount, 80
    if ErrorLevel
        MonCount := 1

    Found := false
    Loop, %MonCount%
    {
        SysGet, Work, Monitor , %A_Index%

        if (X >= WorkLeft && X <= WorkRight && Y >= WorkTop && Y <= WorkBottom)
        {
            TargetLeft   := WorkLeft
            TargetTop    := WorkTop
            TargetRight  := WorkRight
            TargetBottom := WorkBottom
            Found := true
            break
        }
    }
    ; fallback on failure
    if (!Found)
    {
        SysGet, Target, Monitor , 1
    }

    ; adjust position if needed
    RepositionNeeded := false

    if (WinX + WinWidth > TargetRight)
    {
        X := TargetRight - WinWidth - 5
        RepositionNeeded := true
    }
    else if (WinX < TargetLeft)
    {
        X := TargetLeft + 5
        RepositionNeeded := true
    }

    if (WinY + WinHeight > TargetBottom)
    {
        Y := TargetBottom - WinHeight - 5
        RepositionNeeded := true
    }
    else if (WinY < TargetTop)
    {
        Y := TargetTop + 5
        RepositionNeeded := true
    }

    if RepositionNeeded
        Gui, CustomTooltip: Show, NoActivate x%X% y%Y%, CustomTooltip

    ; create rounded edges
    DllCall("SetWindowRgn", "ptr", WinExist("CustomTooltip"), "ptr", CreateRoundedRect(WinWidth, WinHeight, Radius), "int", true)

    ; timers
    SetTimer, DestroyTooltip, -%Timer%
    SetTimer, CheckMouseOver, 100
}



; rounded rectangle region creation
CreateRoundedRect(Width, Height, Radius) {
    hRgn := DllCall("CreateRoundRectRgn", "int", 0, "int", 0, "int", Width + 1, "int", Height + 1, "int", Radius * 2, "int", Radius * 2, "ptr")
    return hRgn
}

this ahk v1 code btw (code is also in the zip and a exe version)

MNodes Remap Keys v1.6.zip (610.1 KB)

to make it run at startup make a shortcut and put it in here:

Users\your name\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

updated the code and text above and also added it all as a zip with a exe included see above post

when i find a way to add rename and copy and paste appearance and size to it i will at that point make an interface with adjustable hotkeys but for that i need the name of the popup menu i havent found jet. alternatively i could use the windows message being send which i have not looked for jet. i achieved what i wanted and i might extend on it lateron.

was fun coding a bit again i hadnt realy since i got mnodes

enjoy

1.3 done for now all behaves as i like it i am open to suggestions or helping someone out modifying it to taste

v1.4 - i found enabled tooltip inconsistant coming out of suspend so added a pause and also added a startup tooltip

ive investigated if i could do more as i suggested before but i cant do anything else than sending native hotkeys for stuff with other keys than mnodes so any suggestion would need to be based of that i consider it done for myself

another note i could not find a reason to turn it off in perform but there might be one if right mouse or middle mouse click is somehow used in your gui

v1.5 see top post for download

  • ive removed the alt options because it was intefering with mnodes hold alt option i had not thought about that in my hurries
  • ive changed exit app hotkey to ctrl + esc
  • ive changed suspend hotkey to f9 or f10
  • ive added f11 as a option to bring up node picker/right click options
  • finetuned enabled/suspended tooltip show time (shorter)

now it is very easy to toggle navigation style or bring up menu’s one handed on keyboard because ive added options to f9 f10 f11 f12

i still use this because i like to toggle between styles usualy when i am working on the top i have it on. i also like to slam my keyboard somewhere in a general area hence i added 4 rename F keys

v1.6

  • removed all modifyer combinations because mnodes has a lot of new hotkeys and the ability to move all i wanted to the remaining F keys
  • added the nodes help to F1

see top post for the zip or code (zip also has the code)

i hope mario dont get mad i used a green version of mnodes icon