Available since LÖVE 0.7.0
This callback is not supported in earlier versions.
Callback function triggered when window receives or loses focus.
love.focus( focus )
boolean focusNothing.
function love.load()
text = "FOCUSED"
end
function love.draw()
love.graphics.print(text,0,0)
end
function love.focus(f)
if f then
print("Window is focused.")
text = "FOCUSED"
else
print("Window is not focused.")
text = "UNFOCUSED"
end
end
© 2006–2016 LÖVE Development Team
Licensed under the GNU Free Documentation License, Version 1.3.
https://love2d.org/wiki/love.focus