love.keyboard.isDown

Checks whether a certain key is down.

Function

Synopsis

down = love.keyboard.isDown( key )

Arguments

KeyConstant key
The key to check.

Returns

boolean down
True if the key is down, false if not.

Examples

Quit on hitting escape

function love.keypressed(k)
	if k == 'escape' then
		love.event.push('q') -- quit the game
	end	
end

See Also


Other Languages