lovr.focus

Edit

The lovr.focus callback is called whenever the application acquires or loses focus (for example, when opening or closing the system VR menu). The callback receives a focused argument, indicating whether or not the application is now focused. Additionally, both the headset and desktop window have separate focus states, so a display argument indicates which display gained or lost input focus. It may make sense to pause the game, reduce visual fidelity, or mute audio when the application loses focus.

function lovr.focus(focused, display)
  -- your code here
end

Arguments

NameTypeDescription
focusedboolean Whether the program is now focused.
displayDisplayType Whether the headset or desktop window changed input focus.

Returns

Nothing

See also