Skip to content

OnCursorChange

The player’s cursor came up or went away.

The player brings up their cursor with the cursor key (left Alt unless they picked another in the launcher): a tap switches it on or off, holding the key shows it until the key comes up. SetCursorShown switches it too. While it is up the game’s own pointer is on screen, the view holds still and the keys still walk. It goes away by itself when one of the game’s own menus opens, at a load and when the session ends - and this runs then too. IsCursorShown says the same at any moment.

function OnCursorChange(shown)
-- ...
end
Parameter Type
shown boolean true when the cursor came up, false when it went away

nothing

function OnCursorChange(shown)
if shown then ShowUiElement("toolbar") else HideUiElement("toolbar") end
end

OnCursorClick · IsCursorShown · SetCursorShown · the The game’s UI for a script group of the index