Difference between revisions of "love.keyreleased"

(removed in 0.9.0)
(Updated for 0.10.0)
Line 1: Line 1:
Callback function triggered when a key is released.
+
Callback function triggered when a keyboard key is released.
 +
 
 
== Function ==
 
== Function ==
 
=== Synopsis ===
 
=== Synopsis ===
Line 9: Line 10:
 
=== Returns ===
 
=== Returns ===
 
Nothing.
 
Nothing.
 +
 +
== Function ==
 +
{{newin|[[0.10.0]]|100|type=variant}}
 +
=== Synopsis ===
 +
<source lang="lua">
 +
love.keyreleased( key, scancode )
 +
</source>
 +
=== Arguments ===
 +
{{param|KeyConstant|key|Character of the key released.}}
 +
{{param|Scancode|scancode|The scancode representing the key that was released.}}
 +
=== Returns ===
 +
Nothing.
 +
=== 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 pressed, no matter what the key is labelled or what the user's operating system settings are.
 +
 
== Examples ==
 
== Examples ==
 
Exit the game when the player releases the Escape key, using [[love.event.quit]].  
 
Exit the game when the player releases the Escape key, using [[love.event.quit]].  
Line 21: Line 37:
 
* [[parent::love]]
 
* [[parent::love]]
 
* [[love.keypressed]]  
 
* [[love.keypressed]]  
* [[love.keyboard.isDown]]  
+
* [[love.keyboard.isDown]]
 
[[Category:Callbacks]]
 
[[Category:Callbacks]]
{{#set:Description=Callback function triggered when a key is released.}}
+
{{#set:Description=Callback function triggered when a keyboard key is released.}}
 
{{#set:Subcategory=General}}
 
{{#set:Subcategory=General}}
 
{{#set:Since=000}}
 
{{#set:Since=000}}
 
== Other Languages ==
 
== Other Languages ==
 
{{i18n|love.keyreleased}}
 
{{i18n|love.keyreleased}}

Revision as of 02:06, 17 December 2015

Callback function triggered when a keyboard key is released.

Function

Synopsis

love.keyreleased( key )

Arguments

KeyConstant key
Character of the key released.

Returns

Nothing.

Function

Available since LÖVE 0.10.0
This variant is not supported in earlier versions.

Synopsis

love.keyreleased( key, scancode )

Arguments

KeyConstant key
Character of the key released.
Scancode scancode
The scancode representing the key that was released.

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 pressed, 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