Class engine.KeyBind
Handles key binds to "virtual" actions
Methods
engine.KeyBind:load (str)
Loads a list of keybind definitions Keybind definitions are in /data/keybinds/.
engine.KeyBind:loadRemap (file)
Loads a keybinds remap
engine.KeyBind:saveRemap (file)
Saves a keybinds remap
engine.KeyBind:getBindTable (type)
Returns the binding table for the given type
engine.KeyBind:bindKeys ()
Binds all virtuals to keys, either defaults or remapped ones
engine.KeyBind:unicodeInput (v)
Allow receiving unicode events
engine.KeyBind:reset ()
Reset all binds
engine.KeyBind:triggerVirtual (virtual)
Force a key to trigger
engine.KeyBind:addBind (virtual, fct)
Adds a key/command combination
engine.KeyBind:addBinds (t)
Adds a key/command combination
engine.KeyBind:removeBind (virtual)
Removes a key/command combination
Methods
- engine.KeyBind:load (str)
-
Loads a list of keybind definitions
Keybind definitions are in /data/keybinds/. Modules can define new ones.
Parameters:
- str a string representing the keybind, separated by commas. I.e: "move,hotkeys,actions,inventory"
- engine.KeyBind:loadRemap (file)
-
Loads a keybinds remap
Parameters:
- file
- engine.KeyBind:saveRemap (file)
-
Saves a keybinds remap
Parameters:
- file
- engine.KeyBind:getBindTable (type)
-
Returns the binding table for the given type
Parameters:
- type
- engine.KeyBind:bindKeys ()
- Binds all virtuals to keys, either defaults or remapped ones
- engine.KeyBind:unicodeInput (v)
-
Allow receiving unicode events
Parameters:
- v
- engine.KeyBind:reset ()
- Reset all binds
- engine.KeyBind:triggerVirtual (virtual)
-
Force a key to trigger
Parameters:
- virtual
- engine.KeyBind:addBind (virtual, fct)
-
Adds a key/command combination
Parameters:
- virtual the key to handle
- fct the function to call when the key is pressed
- engine.KeyBind:addBinds (t)
-
Adds a key/command combination
Parameters:
- t {virtual: fct}
See also:
- engine.KeyBind:removeBind (virtual)
-
Removes a key/command combination
Parameters:
- virtual