Keyboards

The keyboard is the most common input device for desktop games. There are two ways to handle keyboard input in Xenko:

  • query key states

You can query key states and state changes with the following methods:

Note

In some cases, you want to know all the keys that are currently Down, or all the keys that have been Pressed since the last update. The key state API isn't good for this situation, as you have to query each available key separately.

Public ListDescription l
Gets a list of the keys that were down in the last update.
InputManager.PressedKeysGets a list of the keys pressed in the last update.
Gets a list of the keys released in the last update.
InputManager.KeyEventsGets a list of the key events in the last update (keys pressed or released).

Every has two properties: Key (the affected key) and (the new state of the key).