Module ...

Receives keypresses and acts upon them

Functions

_M:addCommand (sym, mods, fct, anymod) Adds a key/command combination
_M:addCommands (t) Adds many key/command at once
_M:addIgnore (sym, v) Adds a key to be fully ignored
_M:reset () Reset all binds
_M:setTextInput (fct) Receives any unbound keys as UTF8 characters (if possible)
_M:setupProfiler () Adds the profiler keybind (ctrl, alt, shift, p)
_M:setupRebootKeys () Adds the game reboot keybind (ctrl, alt, shift, r/n)


Functions

_M:addCommand (sym, mods, fct, anymod)
Adds a key/command combination

Parameters

  • sym: the key to handle
  • mods: a table with the mod keys needed, i.e: {"ctrl", "alt"}
  • fct: the function to call when the key is pressed
  • anymod:
_M:addCommands (t)
Adds many key/command at once

Parameters

  • t:

Usage:

self.key:addCommands{
_LEFT = function()
print("left")
end,
_RIGHT = function()
print("right")
end,
{{"x","ctrl"}] = function()
print("control+x")
end,
}
_M:addIgnore (sym, v)
Adds a key to be fully ignored

Parameters

  • sym: the key to handle
  • v: boolean to ignore or not
_M:reset ()
Reset all binds
_M:setTextInput (fct)
Receives any unbound keys as UTF8 characters (if possible)

Parameters

  • fct: the function to call for each key, get a single parameter to pass the UTF8 string
_M:setupProfiler ()
Adds the profiler keybind (ctrl, alt, shift, p)
_M:setupRebootKeys ()
Adds the game reboot keybind (ctrl, alt, shift, r/n)

Valid XHTML 1.0!