Difference between revisions of "love.keyreleased"

m (Add more see alsos.)
m ("q" --> "quit" for 0.8.0)
Line 14: Line 14:
 
function love.keyreleased(key)
 
function love.keyreleased(key)
 
   if key == "escape" then
 
   if key == "escape" then
       love.event.push("q")  -- actually causes the app to quit
+
       love.event.push("quit")  -- actually causes the app to quit
 
   end
 
   end
 
end
 
end

Revision as of 20:47, 8 April 2012

Callback function triggered when a key is released.

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.push("quit")   -- actually causes the app to quit
   end
end

See Also


Other Languages