Input Keys

Learn more about Makinom’s input system.

Input keys build a control layer between Makinom and various input sources (e.g. Unity’s input manager or 3rd party solutions). This allows inputs to be set via Control HUDs (for virtual on screen controls, e.g. on mobile platforms), schematics (Set Input Key node) or via scripting.

You can create new input keys in Base/Control > Input Keys.

Input Origin #

The input origin defines where an input key’s input is coming from. There are several input origins available out of the box and you can use the Custom input origin to quickly connect 3rd party input systems via reflection.

You can also create custom input origins by deriving your class from the BaseInputIDKeySetting. Check out the included input origins for examples.

Input Origin: Select where the input of the key will come from:

Acceleration #

Uses a selected axis of the last linear acceleration of a device.

This is usually only available on mobile devices that have an acceleration sensor.

Custom #

Uses reflection to call static functions of a class.

You can add parameters to the function calls, e.g. a string parameter to pass on an identifier/name for the input you want to use.

Button Function #

The function for button input has to return a bool value.

Axis Function #

The function for getting the input’s axis value has to return a float value.

Gyroscope #

Uses a selected axis of gyroscope data of a device.

This is usually only available on mobile devices that have an gyroscope sensor.

Input Key #

Uses other input keys as input.

This can be used to bundle multiple sources into a single input key, e.g. when having multiple horizontal and vertical inputs (from keyboard, controllers, etc.).

Another use is key combinations, e.g. allowing Alt + 1 as an input.

Key Code #

Uses the key mapped to a selected key code.

This is a quick and easy way to set up inputs without any additional setup in the Unity input manager or other input sources.

Key Combo #

Uses an input key combo sequence.

This allows getting an input after a defined sequence of input keys was used, e.g. A > A or Up > Down > Up > Down.

The individual parts of the sequence can define a timeout until the sequence is reset and input keys to ignore (i.e. not break the sequence).

Mouse #

Uses a mouse button and mouse position change as axis.

None #

This doesn’t use a direct input.

Use this input origin for input keys that should only receive input from HUDs, schematics or via code.

Touch #

Uses a touch input and touch position change as axis.

This is usually only available on devices with touch screens (e.g. mobile phones or tablets).

Unity Input Manager #

Uses a key defined in the Unity input manager.

E.g. the scroll wheel of a mouse is usually set up via the input manager.

Input IDs #

Input IDs allow having multiple input origins for an input key. They’re used to create different control styles/layouts or allow local multiplayer controls.

The default (global) input ID is 0 when starting a game. Machines can either use the default input ID or override it, i.e. this can be used to have machines with the same schematic react to different input.

The global input ID can also be changed in-game, e.g. for switching control styles.

The minimum input ID is 0, an input ID of -1 can be used to check for any inputs of an input key (ignoring input ID).

Example #

The Accept and Cancel input keys have 2 input origins each.

Accept uses joystick button 1 for input ID 0 and joystick button 2 for input ID 1.

Cancel uses joystick button 2 for input ID 0 and joystick button 1 for input ID 1.

Switching the global input ID between 0 and 1 allows switching the Accept and Cancel input key’s buttons.