OnKeyDown

From MaratisWiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "Check if key has been pressed. While isKeyPressed will return "true" continuously until a key is released, this function will return "true", when the button is pressed dow...")
 
m
 
(4 intermediate revisions by one user not shown)
Line 1: Line 1:
 +
{{lua-function|onKeyDown|key}}
 +
 
Check if key has been pressed. While [[isKeyPressed]] will return "true" continuously until a key is released, this function will return "true", when the button is pressed down and then "true","false" every few ticks depending on your OS key delay and speed settings.
 
Check if key has been pressed. While [[isKeyPressed]] will return "true" continuously until a key is released, this function will return "true", when the button is pressed down and then "true","false" every few ticks depending on your OS key delay and speed settings.
 +
 +
{{lua-function-param|key|[[Keys|key]] constant}}
  
 
  spaceDown = onKeyDown("SPACE")
 
  spaceDown = onKeyDown("SPACE")
  
 
You can find key constants [http://wiki.maratis3d.org/index.php?title=Keys here]
 
You can find key constants [http://wiki.maratis3d.org/index.php?title=Keys here]
 +
 +
[[Category:Lua scripting]]
 +
[[Category:Lua function]]
 +
[[Category:Input]]

Latest revision as of 19:58, 8 February 2014

onKeyDown(key)

Check if key has been pressed. While isKeyPressed will return "true" continuously until a key is released, this function will return "true", when the button is pressed down and then "true","false" every few ticks depending on your OS key delay and speed settings.

  • key : key constant
spaceDown = onKeyDown("SPACE")

You can find key constants here

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox