pub enum InputCode {
Device {
id: SpecifyDevice,
input: DeviceInput,
},
Gamepad {
id: SpecifyGamepad,
input: GamepadInput,
},
}
Expand description
Enum that specifies an input
Variants§
Implementations§
Source§impl InputCode
impl InputCode
pub fn is_any(self) -> bool
pub fn has_device_id(&self, id: DeviceId) -> bool
pub fn has_gamepad_id(&self, id: GamepadId) -> bool
Sourcepub fn set_gamepad_id(self, id: GamepadId) -> Self
pub fn set_gamepad_id(self, id: GamepadId) -> Self
sets the gamepad id. if its a device it does nothing.
Sourcepub fn set_device_id(self, id: DeviceId) -> Self
pub fn set_device_id(self, id: DeviceId) -> Self
sets the device id. if its a gamepad it does nothing.
Trait Implementations§
Source§impl From<DeviceInput> for InputCode
impl From<DeviceInput> for InputCode
Source§fn from(value: DeviceInput) -> Self
fn from(value: DeviceInput) -> Self
Converts to this type from the input type.
Source§impl From<GamepadInput> for InputCode
impl From<GamepadInput> for InputCode
Source§fn from(value: GamepadInput) -> InputCode
fn from(value: GamepadInput) -> InputCode
Converts to this type from the input type.
Source§impl From<MouseButton> for InputCode
impl From<MouseButton> for InputCode
Source§fn from(value: MouseButton) -> Self
fn from(value: MouseButton) -> Self
Converts to this type from the input type.
Source§impl From<PhysicalKey> for InputCode
impl From<PhysicalKey> for InputCode
Source§fn from(value: PhysicalKey) -> Self
fn from(value: PhysicalKey) -> Self
Converts to this type from the input type.
impl Copy for InputCode
impl Eq for InputCode
impl StructuralPartialEq for InputCode
Auto Trait Implementations§
impl Freeze for InputCode
impl RefUnwindSafe for InputCode
impl Send for InputCode
impl Sync for InputCode
impl Unpin for InputCode
impl UnwindSafe for InputCode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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
.Source§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
.Source§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.Source§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.