OnKeyDown
From MaratisWiki
(Difference between revisions)
Dahnielson (Talk | contribs) |
Dahnielson (Talk | contribs) m |
||
Line 2: | Line 2: | ||
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") |
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