Page 1 of 1

Closing window?

Posted: Sun Jan 31, 2010 3:53 am
by scripto
Is it possible to close the window by pressing a key, i've been looking on the doc for about 1 hour and i haven't found anything to close the window without using your mouse.

Re: Closing window?

Posted: Sun Jan 31, 2010 4:22 am
by TechnoCat

Code: Select all

love.event.push('q') --Exits LOVE
http://love2d.org/docs/love_event_push_1.html

Re: Closing window?

Posted: Sun Jan 31, 2010 4:30 am
by Taehl
Here you go. This code will close the window when you press the Esc button.

Code: Select all

function love.keypressed( key )
	if key == "escape" then
		love.event.push("q")
	end
end