Difference between revisions of "love.keyreleased"

m
m (Move new signature to the top.)
Line 2: Line 2:
  
 
== Function ==
 
== Function ==
 +
{{newin|[[0.10.0]]|100|type=variant}}
 
=== Synopsis ===
 
=== Synopsis ===
 
<source lang="lua">
 
<source lang="lua">
love.keyreleased( key )
+
love.keyreleased( key, scancode )
 
</source>
 
</source>
 
=== 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.}}
 
=== Returns ===
 
=== Returns ===
 
Nothing.
 
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.
  
 
== Function ==
 
== Function ==
{{newin|[[0.10.0]]|100|type=variant}}
 
 
=== Synopsis ===
 
=== Synopsis ===
 
<source lang="lua">
 
<source lang="lua">
love.keyreleased( key, scancode )
+
love.keyreleased( key )
 
</source>
 
</source>
 
=== 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.}}
 
 
=== Returns ===
 
=== Returns ===
 
Nothing.
 
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 ==

Revision as of 04:39, 28 November 2016

Callback function triggered when a keyboard key is released.

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 released key.
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 pressed, no matter what the key is labelled or what the user's operating system settings are.

Function

Synopsis

love.keyreleased( key )

Arguments

KeyConstant key
Character of the released key.

Returns

Nothing.

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