Module ...

Receieves keypresses and acts upon them

Functions

_M:addCommand (sym, mods, fct, anymod) Adds a key/command combinaison
_M:addCommands (t) Adds many key/command at once
_M:loadLocaleConvertion (file) Loads a locale converter WARNING: This only converts the "sym" key, *NOT* the unicode key
_M:setTextInput (fct) Receieves any unbound keys as UTF8 characters (if possible)
_M:setupProfiler () Adds the profiler keybind (ctrl, alt, chift, p)


Functions

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

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:loadLocaleConvertion (file)
Loads a locale converter WARNING: This only converts the "sym" key, *NOT* the unicode key

Parameters

  • file: the locale convertion file to load
_M:setTextInput (fct)
Receieves 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, chift, p)

Valid XHTML 1.0!