HID
Human Interface Device (HID) module provides APIs to access platform's input and output devices, like mouse, keyboard, controller, etc.
Types
-
Luna::HID::ControllerInputState
The fetched input state for one generic game controller.
-
Luna::HID::ControllerOutputState
The state to set for a controller.
Enumerations
-
Specifies controller buttons. These values can be bitwise-OR combined to select multiple mouse buttons if needed.
-
A platform-independent key code mapping for standard QWERTY keyboard.
-
Specifies mouse button. These values can be bitwise-OR combined to select multiple mouse buttons if needed.
Functions
-
Checks if game controller input is supported on the current platform.
-
ControllerInputState get_controller_state(u32 index)
Fetches the input state of the specified controller.
-
RV set_controller_state(u32 index, const ControllerOutputState &state)
Sets the output state of the specified controller.
-
Checks if keyboard input is supported on the current platform.
-
bool get_key_state(KeyCode key)
Checks the if the specified key on the keyboard is pressed.
-
Checks if mouse input is supported on the current platform.
-
bool get_mouse_button_state(MouseButton mouse_button)
Checks if the specified mouse button is pressed.
-
Get the position of the mouse cursor in screen space.
-
RV set_mouse_pos(i32 x, i32 y)
Sets the OS mouse cursor position. The position is based on the screen coordinates. This only works for platforms that support mouse input.