Lock mouse to window/screen

Just set up dual monitors for the first time. Trying to set up a macro to enable/disable lock cursor to window. Tried this:

/click InterfaceOptionsMousePanelLockCursorToScreen

Doesn’t work. Tried changing Screen to Window, still no luck. Any ideas?

2 Likes

I’m sure you found the answer by now, but google brought me here while I was trying to find the updated version. Here it is for others:

/run local k,v = “ClipCursor” v = C_CVar.GetCVar(k) C_CVar.SetCVar(k, 1 - v) print("Cursor Locked to Screen " … (v == “1” and “Disabled” or “Enabled”))

Make sure to wrap your code in code tags or the forums do horrible things to the quotes.

/run local k,v = "ClipCursor" v = C_CVar.GetCVar(k) C_CVar.SetCVar(k, 1 - v) print("Cursor Locked to Screen " … (v == "1" and "Disabled" or "Enabled"))