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