{{newin|[[0.7.0]]|070|type=callback}}
Callback function triggered when window receives or loses focus.
== Function ==
=== Synopsis ===
<source lang="lua">
love.focus( focus )
</source>
=== Arguments ===
{{param|boolean|focus|True if the window gains focus, false if it loses focus. }}
=== Returns ===
Nothing.
== Example ==
<source lang="lua">

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

</source>

== See Also ==
* [[parent::love]]
[[Category:Callbacks]]
{{#set:Description=Callback function triggered when window receives or loses focus.}}
{{#set:Subcategory=Window}}
== Other Languages ==
{{i18n|love.focus}}