onKeyDown

Getting triggered once when keyboard key is down accepts key combos. (NOTE: triggered once even if the key is held)

Prototypes
onKeyDown(callback) -- callback = function(keys)
Parameters
    • function(keys): callback function

      • keys: string
Usage
onKeyDown(function(keys)
  if keys == "W" then
  	print("Move north!")
  elseif keys == "Ctrl+W" then
  	print("Look north!")
  elseif keys == "Alt+D" then
  	print("Look east?")
  end
end)