Struct ggez_goodies::input::InputState
[−]
[src]
pub struct InputState<Axes, Buttons> where
Axes: Hash + Eq + Clone,
Buttons: Hash + Eq + Clone, { /* fields omitted */ }
Methods
impl<Axes, Buttons> InputState<Axes, Buttons> where
Axes: Eq + Hash + Clone,
Buttons: Eq + Hash + Clone,
[src]
Axes: Eq + Hash + Clone,
Buttons: Eq + Hash + Clone,
pub fn new() -> Self
[src]
pub fn update(&mut self, dt: f32)
[src]
Updates the logical input state based on the actual physical input state. Should be called in your update() handler. So, it will do things like move the axes and so on.
[src]
This method should get called by your key_down_event handler.
[src]
This method should get called by your key_up_event handler.
pub fn update_axis_start(&mut self, axis: Axes, positive: bool)
[src]
This method should get called by your key_up_event handler.
pub fn update_axis_stop(&mut self, axis: Axes, positive: bool)
[src]
pub fn update_effect(
&mut self,
effect: InputEffect<Axes, Buttons>,
started: bool
)
[src]
&mut self,
effect: InputEffect<Axes, Buttons>,
started: bool
)
Takes an InputEffect and actually applies it.
pub fn get_axis(&self, axis: Axes) -> f32
[src]
pub fn get_axis_raw(&self, axis: Axes) -> f32
[src]
[src]
[src]
[src]
Returns whether or not the button was pressed this frame, only returning true if the press happened this frame.
Basically, get_button_down()
and get_button_up()
are level
triggers, this and get_button_released()
are edge triggered.
[src]
pub fn mouse_position()
[src]
pub fn mouse_scroll_delta()
[src]
[src]
[src]
[src]
pub fn reset_input_state(&mut self)
[src]
Trait Implementations
impl<Axes: Debug, Buttons: Debug> Debug for InputState<Axes, Buttons> where
Axes: Hash + Eq + Clone,
Buttons: Hash + Eq + Clone,
[src]
Axes: Hash + Eq + Clone,
Buttons: Hash + Eq + Clone,
Auto Trait Implementations
impl<Axes, Buttons> Send for InputState<Axes, Buttons> where
Axes: Send,
Buttons: Send,
Axes: Send,
Buttons: Send,
impl<Axes, Buttons> Sync for InputState<Axes, Buttons> where
Axes: Sync,
Buttons: Sync,
Axes: Sync,
Buttons: Sync,