{{newin|[[0.9.0]]|090|type=callback}}
Callback function triggered when window receives or loses mouse focus.
== Function ==
=== Synopsis ===
<source lang="lua">
love.mousefocus( focus )
</source>
=== Arguments ===
{{param|boolean|focus|Whether the window has mouse focus or not.}}
=== Returns ===
Nothing.
== Example ==
<source lang="lua">

function love.load()
  text = "Mouse is in the window!"
end

function love.draw()
  love.graphics.print(text,0,0)
end

function love.mousefocus(f)
  if not f then
    text = "Mouse is not in the window!"
    print("LOST MOUSE FOCUS")
  else
    text = "Mouse is in the window!"
    print("GAINED MOUSE FOCUS")
  end
end

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