Overrides the default mouselook bindings to perform another binding with the mouse buttons


See also Keybind functions.

Signature:

SetMouselookOverrideBinding("key", "binding")

Arguments:

  • key - The mouselook key to override (string)

    • BUTTON1 - Override the left mouse button
    • BUTTON2 - Override the right mouse button

  • binding - The binding to perform instead of mouselooking, or nil to clear the override (string)

Examples:

-- Uses the 'z' button to activate mouselook instead of the mouse buttons,
-- and the mouse buttons to move forward and backward instead of mouselooking.
-- Credits to slouken for this code.
CreateFrame("Button", "MouselookButton")
MouselookButton:RegisterForClicks("AnyUp", "AnyDown")
MouselookButton:SetScript("OnClick", function (self, button, down)
  if ( down ) then
MouselookStart()
  else
MouselookStop()
  end
end)
SetOverrideBindingClick(MouselookButton, nil, "Z", "MouselookButton")
SetMouselookOverrideBinding("BUTTON1", "MOVEFORWARD")
SetMouselookOverrideBinding("BUTTON2", "MOVEBACKWARD")