[][src]Struct gilrs::Mapping

pub struct Mapping { /* fields omitted */ }

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]

impl Debug for MappingData[src]

impl Default for MappingData[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.