Skip to main content

Input

To process input from the window use window.Input class.

Complete example of basic camera movement is in this example

Keyboard

To check if a keyboard button is pressed use GetButton method

var input = window.Input;

if (input.GetButton(KeyCode.Escape) == KeyStatus.Pressed)
window.Close();

Mouse

You can get mouse position by accessing window.Input.MousePosition

To get status of a mouse button you can use GetMouseButton which is simlar to GetButton

if (input.GetMouseButton(MouseKeyCode.Left) == KeyStatus.Pressed)
input.SetMouseInputMode(MouseInputMode.Disable);

You can hide or show the cursor by using SetMouseInputMode method