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 const MOUSE_MOVE_X_POS: Self = _
pub const MOUSE_MOVE_X_NEG: Self = _
pub const MOUSE_MOVE_Y_POS: Self = _
pub const MOUSE_MOVE_Y_NEG: Self = _
pub const MOUSE_SCROLL_X_POS: Self = _
pub const MOUSE_SCROLL_X_NEG: Self = _
pub const MOUSE_SCROLL_POS: Self = _
pub const MOUSE_SCROLL_NEG: Self = _
pub fn gamepad_axis_pos(axis: Axis) -> Self
pub fn gamepad_axis_neg(axis: Axis) -> Self
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.
pub fn set_axis_sign(self, sign: AxisSign) -> Self
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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.