pub struct InputData { /* private fields */ }Expand description
A collection of data used for input callbacks.
InputCallbacks holds the callbacks themselves.
Implementations§
Source§impl InputData
impl InputData
pub fn just_pressed<I: Into<GenericInput>>(&self, input: I) -> bool
pub fn just_pressed_any<I: Into<GenericInput>>( &self, inputs: impl IntoIterator<Item = I>, ) -> bool
pub fn just_pressed_all<I: Into<GenericInput>>( &self, inputs: impl IntoIterator<Item = I>, ) -> bool
pub fn just_pressed_iter(&self) -> impl ExactSizeIterator<Item = GenericInput>
pub fn just_released<I: Into<GenericInput>>(&self, input: I) -> bool
pub fn just_released_any<I: Into<GenericInput>>( &self, inputs: impl IntoIterator<Item = I>, ) -> bool
pub fn just_released_all<I: Into<GenericInput>>( &self, inputs: impl IntoIterator<Item = I>, ) -> bool
pub fn just_released_iter(&self) -> impl ExactSizeIterator<Item = GenericInput>
Sourcepub fn press<I: Into<GenericInput>>(&mut self, input: I)
pub fn press<I: Into<GenericInput>>(&mut self, input: I)
Registers the given input as pressed
pub fn pressed<I: Into<GenericInput>>(&self, input: I) -> bool
pub fn pressed_all<I: Into<GenericInput>>( &self, inputs: impl IntoIterator<Item = I>, ) -> bool
pub fn pressed_any<I: Into<GenericInput>>( &self, inputs: impl IntoIterator<Item = I>, ) -> bool
pub fn pressed_for<I: Into<GenericInput>>(&self, input: I) -> Option<Duration>
pub fn pressed_iter(&self) -> impl ExactSizeIterator<Item = GenericInput>
pub fn update_modifiers(&mut self, modifiers: Modifiers)
pub fn just_pressed_combination<I: Into<GenericInput>>( &self, inputs: impl IntoIterator<Item = I>, modifiers: Modifiers, ) -> bool
pub fn pressed_combination<I: Into<GenericInput>>( &self, inputs: impl IntoIterator<Item = I>, modifiers: Modifiers, ) -> bool
pub fn just_released_combination<I: Into<GenericInput>>( &self, inputs: impl IntoIterator<Item = I>, modifiers: Modifiers, ) -> bool
Sourcepub fn pressed_alt(&self) -> bool
pub fn pressed_alt(&self) -> bool
Returns true if any alt key is pressed
Sourcepub fn pressed_ctrl(&self) -> bool
pub fn pressed_ctrl(&self) -> bool
Returns true if any ctrl key is pressed
Sourcepub fn pressed_logo(&self) -> bool
pub fn pressed_logo(&self) -> bool
Returns true if the logo key is pressed
Sourcepub fn pressed_shift(&self) -> bool
pub fn pressed_shift(&self) -> bool
Returns true if any shift key is pressed
Sourcepub fn release<I: Into<GenericInput>>(&mut self, input: I)
pub fn release<I: Into<GenericInput>>(&mut self, input: I)
Registers the given input as released
pub fn update<I: Into<GenericInput>>(&mut self, value: I, state: ElementState)
pub fn key_just_pressed_iter(&self) -> impl Iterator<Item = VirtualKeyCode>
pub fn key_just_released_iter(&self) -> impl Iterator<Item = VirtualKeyCode>
pub fn key_pressed_iter(&self) -> impl Iterator<Item = VirtualKeyCode>
Trait Implementations§
Source§impl<D> CallbackCallable<D> for InputData
impl<D> CallbackCallable<D> for InputData
type CallbackStruct = InputCallbacks<D>
fn call_callbacks( &self, event_helper: &mut EventHelper<D>, callbacks: &Self::CallbackStruct, )
Auto Trait Implementations§
impl Freeze for InputData
impl RefUnwindSafe for InputData
impl Send for InputData
impl Sync for InputData
impl Unpin for InputData
impl UnwindSafe for InputData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more