Difference between revisions of "love.keyreleased"

m
Line 16: Line 16:
 
function love.keyreleased(key)
 
function love.keyreleased(key)
 
   if key == "escape" then
 
   if key == "escape" then
       love.event.push("quit")   -- actually causes the app to quit
+
       love.event.quit()
 
   end
 
   end
 
end
 
end

Revision as of 05:53, 2 November 2013

Callback function triggered when a key is released.

Unlike love.keypressed, love.keyreleased does not have an unicode argument because those characters are only generated when keys are pressed.

Function

Synopsis

love.keyreleased( key )

Arguments

KeyConstant key
Character of the key released.

Returns

Nothing.

Examples

Exit the game when the player releases the Escape key, using love.event.push.

function love.keyreleased(key)
   if key == "escape" then
      love.event.quit()
   end
end

See Also


Other Languages