class
inputhandles all inputs and sends out generic events that can be subscribed to.
the input class is responsible for translating platform specific input events to a more generalised format, and sending out events that have been subscribed to. for example it will translate all keyboard input messages into a generic key message that remains the same for all platforms. You can however reverse-translate back into the platform specific key messages. Every input instance is tied to a core::
types
classes
enums
static variables
member-functions
Function documentation
template<typename Type>
void core:: systems:: input:: subscribe(Type target)
Brief
automatically subscribes to all the events the target has method signatures for.
Details
The input system checks the target that tries to subscribe itself for several different signatures that satisfy the callbacks. These are:
- T::on_key_pressed(keycode) => when a keycode is pressed (first frame only)
- T::on_key_released(keycode) => when a keycode is released (one frame)
- T::on_key_held(keycode) => when a keycode is held (first frame after pressed)
- T::on_moude_pressed(mousecode) => when a mousecode is pressed (first frame only)
- T::on_mouse_released(mousecode) => when a mousecode is released (one frame)
- T::on_mouse_held(mousecode) => when a mousecode is held (first frame after pressed)
- T::on_mouse_move(mouse_delta) => when the mouse moves, sends the relative coordinates (difference from last tick)
- T::on_mouse_move(mouse_coordinate) => when the mouse moves, sends the absolute coordinates
- T::on_mouse_scroll(scroll_delta) => when the mouse moves, sends the delta change of the scroll in respect to last tick
const mouse_ coordinate& core:: systems:: input:: cursor() const noexcept
Returns | the current mouse coordinate information |
---|