pub enum InputSource {
Key(KeyCode),
Mouse(MouseButton),
Chord(KeyCode, KeyCode),
MouseChord(KeyCode, MouseButton),
}Expand description
Defines an input source that can trigger an action
Used with Input::add_binding() to map hardware inputs to named actions.
§Example
ⓘ
input.add_binding("Jump", InputSource::Key(KeyCode::Space));
input.add_binding("Aim", InputSource::Mouse(MouseButton::Right));
input.add_binding("QuickSave", InputSource::Chord(KeyCode::LControl, KeyCode::S));Variants§
Trait Implementations§
Source§impl Clone for InputSource
impl Clone for InputSource
Source§fn clone(&self) -> InputSource
fn clone(&self) -> InputSource
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InputSource
impl Debug for InputSource
Source§impl Hash for InputSource
impl Hash for InputSource
Source§impl PartialEq for InputSource
impl PartialEq for InputSource
impl Copy for InputSource
impl Eq for InputSource
impl StructuralPartialEq for InputSource
Auto Trait Implementations§
impl Freeze for InputSource
impl RefUnwindSafe for InputSource
impl Send for InputSource
impl Sync for InputSource
impl Unpin for InputSource
impl UnwindSafe for InputSource
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