input¶
| Type | Class |
| Namespace | conjure::platform |
| Include File Path | engine/include/conjure/platform/input.h |
| Source File Path | engine/src/platform/input.cpp |
| API ↗ | Input |
Syntax¶
Constructors¶
| Access | Signature | Description |
|---|---|---|
| public | input(); |
Important
Copy constructor and assignment has been deleted.
Destructors¶
| Access | Signature | Description |
|---|---|---|
| public | ~input(); |
Variables¶
| Access | Name | Type | Default | Description |
|---|---|---|---|---|
| private | m | u64 | 0 | |
| private | mPending | input_state | {} | |
| private | mPublished | input_state | {} | |
| private | m | bool | true | |
| private | mStats | input_stats | {} |
Functions¶
Public¶
apply¶
apply¶bool apply(
const event &value);Applies one pumped event. Returns true when it was an input event; window events return false (a focus_event with focused == false still triggers release_all()).
end_frame¶
end_frame¶void end_frame();Publishes the frame's snapshot (frameIndex incremented) and clears edges, deltas, scroll and text in the accumulating state. Levels persist.
inject¶
inject¶void inject(
const input_event &value);Same state machine as apply(); the source for tests and the editor's input.inject.
void inject(
const event &value);Convenience overload: injects the event when it is an input event, ignores it otherwise.
template <typename EventType> requires std::constructible_from<input_event, const EventType &> && (!std::same_as<EventType, input_event>) && (!std::same_as<EventType, event>) void inject(
const EventType &value);Injects one concrete input alternative (key_event, mouse_move_event, ...) without the caller spelling the variant; both variants convert from the same structs, so this overload is what makes inject(make_key(...)) unambiguous.
release_all¶
release_all¶void release_all() noexcept;Releases every down key, mouse button and gamepad button with a released edge this frame and clears the modifiers (focus loss, the editor's input.clear).
skip_next_mouse_delta¶
skip_next_mouse_delta¶void skip_next_mouse_delta() noexcept;Makes the next mouse_move_event set the position without adding to mouseDelta. The window owner calls this after a cursor mode change, where the OS repositions the cursor and the first report would otherwise read as a jump.
snapshot¶
snapshot¶[[nodiscard]] const input_state &snapshot() const noexcept;The snapshot published by the last end_frame(). Readable from any thread until the next end_frame(); never hold the reference across one.
stats¶
stats¶[[nodiscard]] const input_stats &stats() const noexcept;Private¶
apply_cursor_enter¶
apply_cursor_enter¶void apply_cursor_enter(
const cursor_enter_event &value);apply_gamepad_axis¶
apply_gamepad_axis¶void apply_gamepad_axis(
const gamepad_axis_event &value);apply_gamepad_button¶
apply_gamepad_button¶void apply_gamepad_button(
const gamepad_button_event &value);apply_gamepad_connection¶
apply_gamepad_connection¶void apply_gamepad_connection(
const gamepad_connection_event &value);apply_input¶
apply_input¶void apply_input(
const input_event &value);apply_mouse_button¶
apply_mouse_button¶void apply_mouse_button(
const mouse_button_event &value);apply_mouse_move¶
apply_mouse_move¶void apply_mouse_move(
const mouse_move_event &value);apply_mouse_scroll¶
apply_mouse_scroll¶void apply_mouse_scroll(
const mouse_scroll_event &value);apply_text¶
apply_text¶void apply_text(
const text_event &value);gamepad_for¶
gamepad_for¶[[nodiscard]] gamepad_state *gamepad_for(
u8 index);