Extensions Key Down

boolean mmf.keyboard.keyDown ( number key )

Test if one of the keyboard keys is currently held down.  A list of valid virtual key constants can be found here.

Parameters

key A virtual key constant

Return Values

boolean true if the key is held down, false otherwise

Example

-- Assume we have an object "hero"
-- Use the arrow keys to move around
while (mmf.keyboard.keyDown(mmf.VK_RIGHT)) do
  hero.x = hero.x + 1
end


See also:
     Button Down, Button Up, Key Up

Copyright 2010 Justin Aquadro