[][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.

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_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for MappingData
[src]

Auto Trait Implementations

impl Send for Mapping

impl Sync for Mapping

Blanket Implementations

impl<T> From for T
[src]

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

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

type Owned = T

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.