Struct gilrs::Mapping
[−]
[src]
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]
fn new() -> Self
[src]
Creates new Mapping
.
[src]
Returns EvCode
associated with button index.
fn axis(&self, idx: Axis) -> Option<Code>
[src]
Returns EvCode
associated with axis index.
fn insert_btn(&mut self, from: Code, to: Button) -> Option<Code>
[src]
Inserts new button mapping.
fn insert_axis(&mut self, from: Code, to: Axis) -> Option<Code>
[src]
Inserts new axis mapping.
[src]
Removes button and returns associated NativEvCode
.
fn remove_axis(&mut self, idx: Axis) -> Option<Code>
[src]
Removes axis and returns associated NativEvCode
.
Trait Implementations
impl Debug for MappingData
[src]
impl Clone for MappingData
[src]
fn clone(&self) -> MappingData
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more