pub enum ControllerEvent {
ControllerAxisMoved {
which: u32,
axis: ControllerAxis,
value: f32,
},
ControllerButtonPressed {
which: u32,
button: ControllerButton,
},
ControllerButtonReleased {
which: u32,
button: ControllerButton,
},
ControllerDisconnected {
which: u32,
},
ControllerConnected {
which: u32,
},
}Expand description
Controller events generated by the SDL events system.
Variants§
ControllerAxisMoved
Movement event on a controller axis.
Corresponds to SDL_CONTROLLERAXISMOTION.
Fields
§
axis: ControllerAxisThe controller axis.
ControllerButtonPressed
Button press event on a controller.
Corresponds to SDL_CONTROLLERBUTTONDOWN.
ControllerButtonReleased
Button press event on a controller.
Corresponds to SDL_CONTROLLERBUTTONUP.
ControllerDisconnected
Controller disconnect event.
Corresponds to SDL_CONTROLLERDEVICEREMOVED.
Fields
ControllerConnected
Controller connected event.
Corresponds to SDL_CONTROLLERDEVICEADDED.
Trait Implementations§
Source§impl Clone for ControllerEvent
impl Clone for ControllerEvent
Source§fn clone(&self) -> ControllerEvent
fn clone(&self) -> ControllerEvent
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 ControllerEvent
impl Debug for ControllerEvent
Source§impl<'de> Deserialize<'de> for ControllerEvent
impl<'de> Deserialize<'de> for ControllerEvent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'a, T> Into<InputEvent<T>> for &'a ControllerEventwhere
T: BindingTypes,
impl<'a, T> Into<InputEvent<T>> for &'a ControllerEventwhere
T: BindingTypes,
Source§fn into(self) -> InputEvent<T>
fn into(self) -> InputEvent<T>
Converts this type into the (usually inferred) input type.
Source§impl PartialEq for ControllerEvent
impl PartialEq for ControllerEvent
Source§impl Serialize for ControllerEvent
impl Serialize for ControllerEvent
impl Copy for ControllerEvent
impl StructuralPartialEq for ControllerEvent
Auto Trait Implementations§
impl Freeze for ControllerEvent
impl RefUnwindSafe for ControllerEvent
impl Send for ControllerEvent
impl Sync for ControllerEvent
impl Unpin for ControllerEvent
impl UnsafeUnpin for ControllerEvent
impl UnwindSafe for ControllerEvent
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> Config for Twhere
T: for<'a> Deserialize<'a> + Serialize,
impl<T> Config for Twhere
T: for<'a> Deserialize<'a> + Serialize,
Source§fn load<P>(path: P) -> Result<T, ConfigError>
fn load<P>(path: P) -> Result<T, ConfigError>
Loads a configuration structure from a file.
Source§fn load_bytes(bytes: &[u8]) -> Result<T, ConfigError>
fn load_bytes(bytes: &[u8]) -> Result<T, ConfigError>
Loads configuration structure from raw bytes.
Source§fn write<P>(&self, path: P) -> Result<(), ConfigError>
fn write<P>(&self, path: P) -> Result<(), ConfigError>
Writes a configuration structure to a file.
Source§fn load_no_fallback<P>(path: P) -> Result<Self, ConfigError>
fn load_no_fallback<P>(path: P) -> Result<Self, ConfigError>
👎Deprecated:
use load instead
Loads a configuration structure from a file.
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> SetParameter for T
impl<T> SetParameter for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.