|
|
Function
love.keyboard.isDown( key )
Checks whether a certain key is down. For list of accepted keys, see Constants.
Synopsis
var = love.keyboard.isDown( key )
Arguments
key
The key in question.
Returns
boolean
Whether the passed key is pressed down.
See Also
Constants, keypressed, keyrelreased
Examples
Example 10: Checking if a key is down
function draw() -- Checks whether the return key is down or not. if love.keyboard.isDown(love.key_return) then love.graphics.draw("The key is down.", 50, 50) else love.graphics.draw("The key isn't down.", 50, 50) end end
Copyright © 2006-2008 LÖVE Development Team.
|