The input system provides access to the HID devices connected to the host machine. The global input system object can be retrieved using the GetInputSystem function.
A list of devices connected to the host machine can be retrieved by calling the GetDevices function.
It is the application programmer responsibility to call the Update function each time the input system and devices state needs to be refreshed. In most application, this will be done exactly once per frame.
The InputDevice key or button state can then be queried through
KeyCode by using the following functions:
Trueif the key or button was down during the last update.
Trueif the key or button was down two updates ago.
Trueif the key or button was down two updates ago and released during the last update.
These functions return a binary
The main keyboard device connected to the host is always retrieved using the
keyboard device identifier. All of the keyboard keys can be queried by using their corresponding
The main mouse device connected to the host is always retrieved using the
mouse device identifier. The mouse buttons state can be read from the
KeyButton0 and upward key codes. The mouse cursor position can be read from the
InputAxisY input codes.
The mouse wheel is mapped to the
InputAxisZ input code.
The input system uses the platform SDK, Direct Input 8 and XInput to access HID devices. XInput device ports are easily identified as
At the moment XInput only supports XBox 360 and XBox One controllers. If you need to use a controller such as the Playstation 4 one you should use its Direct Input 8 identifier (starting with