Skip to main content

Module input

Module input 

Source
Expand description

This module contains a set of “shortcuts” that allows getting the state of a mouse and a keyboard in a simplified manner (read - without using “verbose” event-based approach). It may be useful in simple scenarios where you just need to know if a button (on keyboard, mouse) was pressed and do something. You should always prefer the event-based approach when possible.

Structs§

InputState
A stored state of most common input events. It is used a “shortcut” in cases where event-based approach is too verbose. Important: this structure does not track from which device the corresponding event has come from, if you have more than one keyboard and/or mouse, use event-based approach instead! You should always prefer the event-based approach when possible.
Keyboard
Represents the keyboard state in the current frame. The contents of this structure is a simplified version of event-based approach. Important: this structure does not track from which keyboard the corresponding event has come from, if you have more than one keyboard use event-based approach instead!
Mouse
Represents the mouse state in the current frame. The contents of this structure is a simplified version of event-based approach. Important: this structure does not track from which mouse the corresponding event has come from, if you have more than one mouse use event-based approach instead!