Skip to content

Input

static class · namespace Hazel

public static class Input

Methods

GetConnectedControllerIDs()

static

public static int[] GetConnectedControllerIDs()

GetControllerAxis(int, int)

static

public static float GetControllerAxis(int id, int axis)

GetControllerDeadzone(int, int)

static

public static float GetControllerDeadzone(int id, int axis)

Getter for the specified controller's axis' deadzone, default value is 0.0f

GetControllerHat(int, int)

static

public static byte GetControllerHat(int id, int hat)

GetControllerName(int)

static

public static string GetControllerName(int id)

GetCursorMode()

static

public static CursorMode GetCursorMode()

GetMousePosition()

static

public static Vector2 GetMousePosition()

IsControllerButtonDown(int, GamepadButton)

static

public static bool IsControllerButtonDown(int id, GamepadButton button)

Returns true every frame that the button is down. Equivalent to doing Input.IsMouseButtonPressed(key) || Input.IsMouseButtonHeld(key)

IsControllerButtonDown(int, int)

static

public static bool IsControllerButtonDown(int id, int button)

IsControllerButtonHeld(int, GamepadButton)

static

public static bool IsControllerButtonHeld(int id, GamepadButton button)

Returns true every frame after the button was initially pressed (returns false when Input.IsMouseButtonPressed returns true)

IsControllerButtonHeld(int, int)

static

public static bool IsControllerButtonHeld(int id, int button)

IsControllerButtonPressed(int, GamepadButton)

static

public static bool IsControllerButtonPressed(int id, GamepadButton button)

Returns true during the frame that the button was released

IsControllerButtonPressed(int, int)

static

public static bool IsControllerButtonPressed(int id, int button)

IsControllerButtonReleased(int, GamepadButton)

static

public static bool IsControllerButtonReleased(int id, GamepadButton button)

Returns true during the frame that the button was released

IsControllerButtonReleased(int, int)

static

public static bool IsControllerButtonReleased(int id, int button)

IsControllerPresent(int)

static

public static bool IsControllerPresent(int id)

IsKeyDown(KeyCode)

static

public static bool IsKeyDown(KeyCode keycode)

Returns true every frame that the key is down. Equivalent to doing Input.IsKeyPressed(key) || Input.IsKeyHeld(key)

IsKeyHeld(KeyCode)

static

public static bool IsKeyHeld(KeyCode keycode)

Returns true every frame after the key was initially pressed (returns false when Input.IsKeyPressed returns true)

IsKeyPressed(KeyCode)

static

public static bool IsKeyPressed(KeyCode keycode)

Returns true the first frame that the key represented by the given KeyCode is pressed down

IsKeyReleased(KeyCode)

static

public static bool IsKeyReleased(KeyCode keycode)

Returns true during the frame that the key was released

IsKeyToggledOn(KeyCode)

static

public static bool IsKeyToggledOn(KeyCode keycode)

Returns true if one of the toggleable keys (CapsLock, NumLock, ScrollLock) is toggled on. If keycode is not one of these keys, this will return false.

Parameters

Name Description
keycode

IsMouseButtonDown(MouseButton)

static

public static bool IsMouseButtonDown(MouseButton button)

Returns true every frame that the button is down. Equivalent to doing Input.IsMouseButtonPressed(key) || Input.IsMouseButtonHeld(key)

IsMouseButtonHeld(MouseButton)

static

public static bool IsMouseButtonHeld(MouseButton button)

Returns true every frame after the button was initially pressed (returns false when Input.IsMouseButtonPressed returns true)

IsMouseButtonPressed(MouseButton)

static

public static bool IsMouseButtonPressed(MouseButton button)

Returns true the first frame that the button represented by the given MouseButton is pressed down

IsMouseButtonReleased(MouseButton)

static

public static bool IsMouseButtonReleased(MouseButton button)

Returns true during the frame that the button was released

SetControllerDeadzone(int, int, float)

static

public static void SetControllerDeadzone(int id, int axis, float deadzone)

Setter for the specified controller's axis' deadzone, default value is 0.0f

SetCursorMode(CursorMode)

static

public static void SetCursorMode(CursorMode mode)

Source: Hazel/Core/Input.cs