Input Manager

Search our Site

The Input Manager is a simple tool designed to help developers quickly set up and organize user input, whether it be via Keyboard, Mouse or Controller.

The list on the left hand side contains all of the Keymaps within the project. If your project contains a lot of Keymaps, you can quickly find the one you are searching for by using the search bar, which filters the results. By selecting a Keymap from the list, the Keybind Settings will appear.

A Keybind is a set of instructions which tell Bright Engine when a Keymap has been triggered. Each Keymap should be assigned a Lua function, which can be achieved by typing the name of the function to execute in the top field. You can add a new Keybind by pressing the Green plus sign on the far right hand side of the editor. You are free to add as many Keybinds to a Keymap as you wish. Once a Keybind has been created, its type can be selected (Keyboard, Mouse, or Controller) along with all the other input settings. Weight is a value variable which is passed into the Lua function associated with the Keymap. If you want to remove a Keybind from the Keymap, simply press the Bin Icon on the far right.

Ensure there are no spelling mistakes in the assign Lua function as this is a common cause for silly errors. If you wish to create a new Lua function for your Keymap, you must do so within the project Input.lua file located within the project’s Scripts directory. The Keymaps in the previous screen shot are linked to the following functions which merely print out to the console that the functions are being triggered.

Note that the Input.lua file does not require a main() function. As such attempting to debug the script in the developer suite will not work unless you create a main() function and manually trigger the function you wish to test by calling it.

All functions called by a Keymap must include a value parameter. In this instance the parameter weight is used, however it does not matter which label you decide to use. The value of “weight” is equal to the value set in the Keybind.