|
Capycore Engine
0.1.0
A simple and lightweight game engine written in C++ based on the Unity API architecture.
|
Interface for querying low-level keyboard input. More...
#include <i_input_provider.h>
Public Member Functions | |
| virtual | ~IInputProvider ()=default |
| void | set_input (std::unique_ptr< IInput > input) |
| std::optional< std::reference_wrapper< IInput > > | input () const |
| virtual bool | is_key_held (KeyCode key) const =0 |
| Returns whether the specified key is currently held down. | |
| virtual bool | is_key_pressed (KeyCode key) const =0 |
| Returns true on the frame the specified key transitions to pressed. | |
| virtual KeyCode | get_pressed_key () const =0 |
| Returns the first key pressed this frame. | |
| virtual bool | is_key_released (KeyCode key) const =0 |
| Returns true on the frame the specified key transitions to released. | |
| virtual bool | any_key_held () const =0 |
| Returns true if any key is currently held down. | |
| virtual bool | any_key_pressed () const =0 |
| Returns true if any key was pressed this frame. | |
| virtual bool | any_key_released () const =0 |
| Returns true on the frame any key transitions to released. | |
| virtual bool | is_mouse_held (MouseButton button) const =0 |
| Returns whether the specified mouse button is currently held down. | |
| virtual bool | is_mouse_pressed (MouseButton button) const =0 |
| Returns true on the frame the specified mouse button transitions to pressed. | |
| virtual bool | is_mouse_released (MouseButton button) const =0 |
| Returns true on the frame the specified mouse button transitions to released. | |
| virtual bool | any_mouse_held () const =0 |
| Returns true if any mouse button is currently held down. | |
| virtual bool | any_mouse_pressed () const =0 |
| Returns true if any mouse button was pressed this frame. | |
| virtual bool | any_mouse_released () const =0 |
| Returns true on the frame any mouse button transitions to released. | |
| virtual const Point & | mouse_position () const =0 |
| Returns the current mouse cursor position (X, Y) in window coordinates. | |
| virtual std::pair< float, float > | mouse_delta () const =0 |
| Returns the change in mouse position since the last frame (deltaX, deltaY). | |
| virtual bool | mouse_moved () const =0 |
| Returns true if the mouse moved during the current frame. | |
| virtual std::pair< float, float > | mouse_scroll () const =0 |
| Returns the accumulated scroll offset along X and Y axes. | |
| virtual std::pair< float, float > | mouse_scroll_delta () const =0 |
| Returns the scroll delta since the last frame (deltaX, deltaY). | |
| virtual MouseDirection | mouse_scroll_direction () const =0 |
| Returns the last detected scroll direction as an integer enum. | |
| virtual void | reset_state ()=0 |
| Clears all input states (useful when changing scenes or focus). | |
| virtual void | register_events ()=0 |
| Registers necessary event listeners with the underlying system. | |
| virtual void | update ()=0 |
| Polls the underlying system for input updates. | |
Interface for querying low-level keyboard input.
Defines a unified polling API for backend-specific input providers (e.g., SDL, GLFW, or platform-native implementations).
|
virtualdefault |
|
pure virtual |
Returns true if any key is currently held down.
Handy for pausing or skipping scenes on any user interaction.
Implemented in InputSystem.
|
pure virtual |
Returns true if any key was pressed this frame.
Used for detecting first input or simple "Press any key" prompts.
Implemented in InputSystem.
|
pure virtual |
Returns true on the frame any key transitions to released.
Useful for detecting global input releases or cancellation events.
Implemented in InputSystem.
|
pure virtual |
Returns true if any mouse button is currently held down.
Useful for generic interaction detection or camera controls.
Implemented in InputSystem.
|
pure virtual |
Returns true if any mouse button was pressed this frame.
Detects first mouse interaction or UI click triggers.
Implemented in InputSystem.
|
pure virtual |
Returns true on the frame any mouse button transitions to released.
Helps detect end of drag or click-release events.
Implemented in InputSystem.
|
pure virtual |
Returns the first key pressed this frame.
Useful for detecting initial input.
Implemented in InputSystem.
| std::optional< std::reference_wrapper< IInput > > IInputProvider::input | ( | ) | const |
|
pure virtual |
Returns whether the specified key is currently held down.
Suitable for continuous input such as movement or sustained actions.
Implemented in InputSystem.
|
pure virtual |
Returns true on the frame the specified key transitions to pressed.
Supports one-shot actions such as jumping or confirming selections.
Implemented in InputSystem.
|
pure virtual |
Returns true on the frame the specified key transitions to released.
Useful for detecting input releases or cancellation events.
Implemented in InputSystem.
|
pure virtual |
Returns whether the specified mouse button is currently held down.
Suitable for continuous input such as aiming or dragging.
Implemented in InputSystem.
|
pure virtual |
Returns true on the frame the specified mouse button transitions to pressed.
Supports one-shot actions such as firing or selecting.
Implemented in InputSystem.
|
pure virtual |
Returns true on the frame the specified mouse button transitions to released.
Useful for detecting clicks, drops, or interaction ends.
Implemented in InputSystem.
|
pure virtual |
Returns the change in mouse position since the last frame (deltaX, deltaY).
Can be used to detect relative movement for camera rotation or drag operations.
Implemented in InputSystem.
|
pure virtual |
Returns true if the mouse moved during the current frame.
Useful for conditional logic that only triggers when the cursor changes position.
Implemented in InputSystem.
|
pure virtual |
Returns the current mouse cursor position (X, Y) in window coordinates.
Useful for UI interaction, cursor tracking, or camera control.
Implemented in InputSystem.
|
pure virtual |
Returns the accumulated scroll offset along X and Y axes.
Useful for continuous scrolling or zooming interactions.
Implemented in InputSystem.
|
pure virtual |
Returns the scroll delta since the last frame (deltaX, deltaY).
Useful for detecting incremental scroll events for UI or gameplay.
Implemented in InputSystem.
|
pure virtual |
Returns the last detected scroll direction as an integer enum.
Can be used to determine the general scroll direction (up, down, left, right).
Implemented in InputSystem.
|
pure virtual |
Registers necessary event listeners with the underlying system.
Must be called during initialization to ensure input events are captured.
Implemented in InputSystem.
|
pure virtual |
Clears all input states (useful when changing scenes or focus).
Ensures stale input doesn’t carry over between menus or gameplay.
Implemented in InputSystem.
| void IInputProvider::set_input | ( | std::unique_ptr< IInput > | input | ) |
|
pure virtual |
Polls the underlying system for input updates.
Usually called once per frame before querying input state.
Implemented in InputSystem.