Difference between revisions of "love.keyreleased"
m (Move new signature to the top.) |
m (→Notes: pressed -> released) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 2: | Line 2: | ||
== Function == | == Function == | ||
− | |||
=== Synopsis === | === Synopsis === | ||
<source lang="lua"> | <source lang="lua"> | ||
Line 9: | Line 8: | ||
=== Arguments === | === Arguments === | ||
{{param|KeyConstant|key|Character of the released key.}} | {{param|KeyConstant|key|Character of the released key.}} | ||
− | {{param|Scancode|scancode|The scancode representing the released key.}} | + | {{New feature|0.10.0| |
+ | {{param|Scancode|scancode|The scancode representing the released key.}} }} | ||
=== Returns === | === Returns === | ||
Nothing. | Nothing. | ||
=== Notes === | === Notes === | ||
− | [[Scancode]]s are keyboard layout-independent, so the scancode "w" will be used if the key in the same place as the "w" key on an [https://en.wikipedia.org/wiki/British_and_American_keyboards#/media/File:KB_United_States-NoAltGr.svg American keyboard] is | + | [[Scancode]]s are keyboard layout-independent, so the scancode "w" will be used if the key in the same place as the "w" key on an [https://en.wikipedia.org/wiki/British_and_American_keyboards#/media/File:KB_United_States-NoAltGr.svg American keyboard] is released, no matter what the key is labelled or what the user's operating system settings are. |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Examples == | == Examples == | ||
Line 40: | Line 30: | ||
[[Category:Callbacks]] | [[Category:Callbacks]] | ||
{{#set:Description=Callback function triggered when a keyboard key is released.}} | {{#set:Description=Callback function triggered when a keyboard key is released.}} | ||
− | {{#set:Subcategory= | + | {{#set:Subcategory=Keyboard}} |
{{#set:Since=000}} | {{#set:Since=000}} | ||
== Other Languages == | == Other Languages == | ||
{{i18n|love.keyreleased}} | {{i18n|love.keyreleased}} |
Latest revision as of 04:45, 12 January 2020
Callback function triggered when a keyboard key is released.
Contents
Function
Synopsis
love.keyreleased( key, scancode )
Arguments
KeyConstant key
- Character of the released key.
Available since LÖVE 0.10.0
Scancode scancode
- The scancode representing the released key.
Returns
Nothing.
Notes
Scancodes are keyboard layout-independent, so the scancode "w" will be used if the key in the same place as the "w" key on an American keyboard is released, no matter what the key is labelled or what the user's operating system settings are.
Examples
Exit the game when the player releases the Escape key, using love.event.quit.
function love.keyreleased(key)
if key == "escape" then
love.event.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