[−][src]Struct gilrs::Mapping
Stores data used to map gamepad buttons and axes.
After you add all mappings, use
Gamepad::set_mapping(…)
to change mapping of
existing gamepad.
See examples/mapping.rs
for more detailed example.
Implementations
impl MappingData
[src]
pub fn new() -> Self
[src]
Creates new Mapping
.
pub fn button(&self, idx: Button) -> Option<Code>
[src]
Returns EvCode
associated with button index.
pub fn axis(&self, idx: Axis) -> Option<Code>
[src]
Returns EvCode
associated with axis index.
pub fn insert_btn(&mut self, from: Code, to: Button) -> Option<Code>
[src]
Inserts new button mapping.
pub fn insert_axis(&mut self, from: Code, to: Axis) -> Option<Code>
[src]
Inserts new axis mapping.
pub fn remove_button(&mut self, idx: Button) -> Option<Code>
[src]
Removes button and returns associated NativEvCode
.
pub fn remove_axis(&mut self, idx: Axis) -> Option<Code>
[src]
Removes axis and returns associated NativEvCode
.
Trait Implementations
impl Clone for MappingData
[src]
fn clone(&self) -> MappingData
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for MappingData
[src]
impl Default for MappingData
[src]
fn default() -> MappingData
[src]
Auto Trait Implementations
impl RefUnwindSafe for MappingData
impl Send for MappingData
impl Sync for MappingData
impl Unpin for MappingData
impl UnwindSafe for MappingData
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,