[−][src]Struct ggez_goodies::input::InputState
The object that tracks the current state of the input controls, such as axes, bindings, etc.
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. It will do things like move the axes and so on.
pub fn update_button_down(&mut self, button: Buttons)
[src]
This method should get called by your key_down_event
handler.
pub fn update_button_up(&mut self, button: Buttons)
[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_down_event
handler.
pub fn update_axis_stop(&mut self, axis: Axes, positive: bool)
[src]
This method should get called by your key_up_event
handler.
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]
pub fn get_button_down(&self, axis: Buttons) -> bool
[src]
pub fn get_button_up(&self, axis: Buttons) -> bool
[src]
pub fn get_button_pressed(&self, axis: Buttons) -> bool
[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.
pub fn get_button_released(&self, axis: Buttons) -> bool
[src]
pub fn mouse_position()
[src]
pub fn mouse_scroll_delta()
[src]
pub fn get_mouse_button()
[src]
pub fn get_mouse_button_down()
[src]
pub fn get_mouse_button_up()
[src]
pub fn reset_input_state(&mut self)
[src]
Trait Implementations
impl<Axes: Clone, Buttons: Clone> Clone for InputState<Axes, Buttons> where
Axes: Hash + Eq + Clone,
Buttons: Hash + Eq + Clone,
[src]
Axes: Hash + Eq + Clone,
Buttons: Hash + Eq + Clone,
fn clone(&self) -> InputState<Axes, Buttons>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
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> Sync for InputState<Axes, Buttons> where
Axes: Sync,
Buttons: Sync,
Axes: Sync,
Buttons: Sync,
impl<Axes, Buttons> Send for InputState<Axes, Buttons> where
Axes: Send,
Buttons: Send,
Axes: Send,
Buttons: Send,
impl<Axes, Buttons> Unpin for InputState<Axes, Buttons> where
Axes: Unpin,
Buttons: Unpin,
Axes: Unpin,
Buttons: Unpin,
impl<Axes, Buttons> RefUnwindSafe for InputState<Axes, Buttons> where
Axes: RefUnwindSafe,
Buttons: RefUnwindSafe,
Axes: RefUnwindSafe,
Buttons: RefUnwindSafe,
impl<Axes, Buttons> UnwindSafe for InputState<Axes, Buttons> where
Axes: UnwindSafe,
Buttons: UnwindSafe,
Axes: UnwindSafe,
Buttons: UnwindSafe,
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn is_in_subset(&self) -> bool
unsafe fn to_subset_unchecked(&self) -> SS
fn from_subset(element: &SS) -> SP
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
Sets value
as a parameter of self
.