core::systems::input class

handles 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::os::surface, and all its data (such as mouse coordinates) is invariably tied to that regardless if the actual platform only has a singleton input system.

types

classes

mouse_coordinate
absolute mouse coordinates that also contain the surface width/height.
mouse_delta
contains the mouse delta coordinates in respect to the last message tick.
scroll_delta
delta information for the mouse scroll wheel.

enums

mousecode
codes for the various mouse buttons.
enum classclasspublicpublic
keycode : uint8_t
contains the generic keycodes that platform specific key codes get translated to.
enum classclasspublicpublic

static variables

psl::string_view
keycode_names
array that maps keyboard keycodes to string.
constexprconstexprpublicpublicstaticstatic

member-functions

subscribe<…>
automatically subscribes to all the events the target has method signatures for.
public
subscribe<…>
automatically subscribes to all the events the target has method signatures for.
public
unsubscribe<…>
automatically unsubscribes to all the events the target has method signatures for.
public
unsubscribe<…>
automatically unsubscribes to all the events the target has method signatures for.
public
cursor
const public noexcept

Function documentation

const mouse_coordinate& core::systems::input::cursor() const noexcept

Returns the current mouse coordinate information