[−][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.
Methods
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]
Performs copy-assignment from source
. Read more
impl Debug for MappingData
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom 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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,