Closing window?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
scripto
Prole
Posts: 5
Joined: Sun Jan 31, 2010 3:52 am

Closing window?

Post 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.
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Milwaukee, WI
Contact:

Re: Closing window?

Post by TechnoCat »

Code: Select all

love.event.push('q') --Exits LOVE
http://love2d.org/docs/love_event_push_1.html
User avatar
Taehl
Dreaming in associative arrays
Posts: 1025
Joined: Mon Jan 11, 2010 5:07 am
Location: CA, USA
Contact:

Re: Closing window?

Post 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
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit!
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 7 guests