Struct dotrix_core::input::Input [−][src]
Expand description
Input Service
Collects input events, tracks state changes and provides mapping to game actions
Fields
events: Vec<Event>
events collector
modifiers: Modifiers
modifiers collector
Implementations
pub fn action_state<T>(&self, action: T) -> Option<State> where
Self: ActionMapper<T>,
T: Copy + Eq + Hash,
pub fn action_state<T>(&self, action: T) -> Option<State> where
Self: ActionMapper<T>,
T: Copy + Eq + Hash,
Returns the status of the mapped action.
Returns the status of the raw input
pub fn is_action_activated<T>(&self, action: T) -> bool where
Self: ActionMapper<T>,
T: Copy + Eq + Hash,
pub fn is_action_activated<T>(&self, action: T) -> bool where
Self: ActionMapper<T>,
T: Copy + Eq + Hash,
Checks if mapped action button is pressed
pub fn is_action_deactivated<T>(&self, action: T) -> bool where
Self: ActionMapper<T>,
T: Copy + Eq + Hash,
pub fn is_action_deactivated<T>(&self, action: T) -> bool where
Self: ActionMapper<T>,
T: Copy + Eq + Hash,
Checks if mapped action button is released
pub fn is_action_hold<T>(&self, action: T) -> bool where
Self: ActionMapper<T>,
T: Copy + Eq + Hash,
pub fn is_action_hold<T>(&self, action: T) -> bool where
Self: ActionMapper<T>,
T: Copy + Eq + Hash,
Checks if mapped button is pressed or hold
Set custom ActionMapper
Get mutual mapper reference
Set window size
Mouse scroll delta
Value can be positive (up) or negative (down)
Current mouse position in pixel coordinates. The top-left of the window is at (0, 0)
Difference of the mouse position from the last frame in pixel coordinates
The top-left of the window is at (0, 0).
Returns true if mouse was moved this frame.
This can be handy to do quick check before doing some performance costly operation.
Normalized mouse position
The top-left of the window is at (0, 0), bottom-right at (1, 1)
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Input
impl !UnwindSafe for Input
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more