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