Struct pix_win_loop::Input
source · pub struct Input { /* private fields */ }Expand description
Input handler.
Implementations§
source§impl Input
impl Input
sourcepub fn cursor_pos(&self) -> (f64, f64)
pub fn cursor_pos(&self) -> (f64, f64)
Cursor position (from WindowEvent::CursorMoved).
sourcepub fn physical_keys(
&self
) -> &HashMap<KeyCode, InputState, BuildHasherDefault<FnvHasher>>
pub fn physical_keys( &self ) -> &HashMap<KeyCode, InputState, BuildHasherDefault<FnvHasher>>
All pressed physical keys.
sourcepub fn is_physical_key_pressed(&self, scancode: KeyCode) -> bool
pub fn is_physical_key_pressed(&self, scancode: KeyCode) -> bool
Returns true if a physical key has just been pressed.
sourcepub fn is_physical_key_down(&self, scancode: KeyCode) -> bool
pub fn is_physical_key_down(&self, scancode: KeyCode) -> bool
Returns true if a physical key is down.
sourcepub fn is_physical_key_released(&self, scancode: KeyCode) -> bool
pub fn is_physical_key_released(&self, scancode: KeyCode) -> bool
Returns true if a physical key has just been released.
sourcepub fn logical_keys(
&self
) -> &HashMap<NamedKey, InputState, BuildHasherDefault<FnvHasher>>
pub fn logical_keys( &self ) -> &HashMap<NamedKey, InputState, BuildHasherDefault<FnvHasher>>
All pressed logical keys.
sourcepub fn is_logical_key_pressed(&self, key: NamedKey) -> bool
pub fn is_logical_key_pressed(&self, key: NamedKey) -> bool
Returns true if a logical key has just been pressed.
sourcepub fn is_logical_key_down(&self, key: NamedKey) -> bool
pub fn is_logical_key_down(&self, key: NamedKey) -> bool
Returns true if a logical key is down.
sourcepub fn is_logical_key_released(&self, key: NamedKey) -> bool
pub fn is_logical_key_released(&self, key: NamedKey) -> bool
Returns true if a logical key has just been released.
All pressed mouse buttons.
Returns true if a mouse button has just been pressed.
Returns true if a mouse button is down.
Returns true if a mouse button has just been released.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Input
impl !Send for Input
impl !Sync for Input
impl Unpin for Input
impl !UnwindSafe for Input
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.