Engine → Platform → input_state.h
input_state
| Type | Struct |
| Namespace | conjure::platform |
| Include File Path | engine/include/conjure/platform/input_state.h |
| Source File Path | engine/src/platform/input_state.cpp |
| API ↗ | Input |
Syntax
Variables
| Access | Name | Type | Default | Description |
|---|---|---|---|---|
| public | cursor | bool | true | |
| public | frameIndex | u64 | 0 | |
| public | gamepads | std:: | {} | |
| public | keysDown | key_bitset | {} | |
| public | keysPressed | key_bitset | {} | |
| public | keysReleased | key_bitset | {} | |
| public | modifiers | key_modifier_flags | key_ | |
| public | mouse | u32 | 0 | |
| public | mouse | u32 | 0 | |
| public | mouse | u32 | 0 | |
| public | mouseDelta | math::vec2 | math::vec2(0.0f) | |
| public | mouse | math::vec2 | math::vec2(0.0f) | |
| public | scrollDelta | math::vec2 | math::vec2(0.0f) | |
| public | text | std:: | {} | |
| public | textCount | u32 | 0 |
Functions
Public
gamepad
gamepad[[nodiscard]] const gamepad_state &gamepad(
u32 index) const noexcept;The gamepad in a slot. Asserts on index >= MAX_GAMEPADS and then returns the last slot.
is_key_down
is_key_down[[nodiscard]] bool is_key_down(
key code) const noexcept;True while the key is down, including the frame it was pressed in (is_key_held leaves that frame out).
is_key_held
is_key_held[[nodiscard]] bool is_key_held(
key code) const noexcept;True while the key is down and this is not the frame it was pressed in.
is_key_pressed
is_key_pressed[[nodiscard]] bool is_key_pressed(
key code) const noexcept;True in the frame the key went down.
is_key_released
is_key_released[[nodiscard]] bool is_key_released(
key code) const noexcept;True in the frame the key came up.
is_mouse_button_down
is_mouse_button_down[[nodiscard]] bool is_mouse_button_down(
mouse_button button) const noexcept;True while the mouse button is down, including the frame it was pressed in (is_mouse_button_held leaves that frame out); false for an invalid button.
is_mouse_button_held
is_mouse_button_held[[nodiscard]] bool is_mouse_button_held(
mouse_button button) const noexcept;True while the mouse button is down and this is not the frame it was pressed in; false for an invalid button.
is_mouse_button_pressed
is_mouse_button_pressed[[nodiscard]] bool is_mouse_button_pressed(
mouse_button button) const noexcept;True in the frame the mouse button went down; false for an invalid button.
is_mouse_button_released
is_mouse_button_released[[nodiscard]] bool is_mouse_button_released(
mouse_button button) const noexcept;True in the frame the mouse button came up; false for an invalid button.
text
text[[nodiscard]] std::span<const u32> text() const noexcept;The UTF-32 code points typed this frame, in order (at most MAX_TEXT_CODEPOINTS_PER_FRAME).