LibMousePointer (1.0.0)
DescriptionAllows addon developers to add a mouse pointer surrogate to any scene.Just add the fragment MOUSE_POINTER_FRAGMENT to your scene.if the keybind UI_SHORTCUT_PRIMARY is unused in the KEYBIND_STRIP, the fragment also adds a keybind for “clicking” the left mouse button.If the keybind is already used by your addon, you have to handle the click action on your own.RemarksI do not have a controller for testing. If you like to participate or send feedback, please feel free to do so.https://cdn-eso.mmoui.com/preview/pvw15757.pngAPIlib:ResetPosition()Set the mouse back to screen center.lib:GetCursorPosition()returns x,y position of the mouse pointer.lib:GetControlAtCursor(desiredHandlers)returns a control or nil.lib:InvokeClick(button, desiredHandlers)Clicks the control found.button is optional and defaults to MOUSE_BUTTON_INDEX_LEFTdesiredHandlers is optional and defaults to HIT_TESTING_DESIRED_HANDLERS_ANY.* HIT_TESTING_DESIRED_HANDLERS_ANY* HIT_TESTING_DESIRED_HANDLERS_MOUSE_WHEEL_ONLY* HIT_TESTING_DESIRED_HANDLERS_RECEIVE_DRAG_ONLYSee WINDOWS_MANAGER:GetControlAtCursor()Examplelocal fragment = ZO_SimpleSceneFragment:New(YourTopLevelControl)local sceneName = “sceneName”local scene = ZO_Scene:New(sceneName, SCENE_MANAGER)local function modeChange()local isGamepad = IsConsoleUI() or IsInGamepadPreferredMode()if isGamepad thenscene:RemoveFragmentGroup(FRAGMENT_GROUP.MOUSE_DRIVEN_UI_WINDOW)scene:AddFragmentGroup(FRAGMENT_GROUP.GAMEPAD_DRIVEN_UI_WINDOW)elsescene:RemoveFragmentGroup(FRAGMENT_GROUP.GAMEPAD_DRIVEN_UI_WINDOW)scene:AddFragmentGroup(FRAGMENT_GROUP.MOUSE_DRIVEN_UI_WINDOW)endif MOUSE_POINTER_FRAGMENT thenif isGamepad thenscene:AddFragment(MOUSE_POINTER_FRAGMENT)elsescene:RemoveFragment(MOUSE_POINTER_FRAGMENT)endendendscene:AddFragment(UNIFORM_BLUR_FRAGMENT)modeChange()self.control:RegisterForEvent(EVENT_GAMEPAD_PREFERRED_MODE_CHANGED, modeChange)scene:AddFragment(fragment)local keybindButton = { alignment = KEYBIND_STRIP_ALIGN_LEFT, order = -1000, name = GetString(SI_GAMEPAD_SELECT_OPTION), keybind = “UI_SHORTCUT_PRIMARY”, callback = function(keyUp) LibMousePointer:InvokeClick() end }

