Difference between revisions of "love.keyreleased"
(Add an example) |
|||
Line 9: | Line 9: | ||
=== Returns === | === Returns === | ||
Nothing. | Nothing. | ||
+ | == Examples == | ||
+ | Exit the game when the player releases the Escape key, using [[love.event.push]]. | ||
+ | <source lang="lua"> | ||
+ | function love.keyreleased(key) | ||
+ | if key == "escape" then | ||
+ | love.event.push("q") -- actually causes the app to quit | ||
+ | end | ||
+ | end | ||
+ | </source> | ||
== See Also == | == See Also == | ||
* [[parent::love]] | * [[parent::love]] |
Revision as of 21:08, 26 September 2011
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("q") -- actually causes the app to quit
end
end
See Also
Other Languages
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info