Struct gilrs::GilrsBuilder [−][src]
pub struct GilrsBuilder { /* fields omitted */ }
Allow to create Gilrs
with customized behaviour.
Methods
impl GilrsBuilder
[src]
impl GilrsBuilder
pub fn new() -> Self
[src]
pub fn new() -> Self
Create builder with default settings. Use build()
to create Gilrs
.
pub fn with_default_filters(self, default_filters: bool) -> Self
[src]
pub fn with_default_filters(self, default_filters: bool) -> Self
If true
, use axis_dpad_to_button
,
Jitter
and deadzone
filters with default parameters. Defaults to true
.
pub fn add_mappings(self, mappings: &str) -> Self
[src]
pub fn add_mappings(self, mappings: &str) -> Self
Adds SDL mappings.
pub fn add_env_mappings(self, env_mappings: bool) -> Self
[src]
pub fn add_env_mappings(self, env_mappings: bool) -> Self
If true, will add SDL mappings from SDL_GAMECONTROLLERCONFIG
environment variable.
Defaults to true.
pub fn add_included_mappings(self, included_mappings: bool) -> Self
[src]
pub fn add_included_mappings(self, included_mappings: bool) -> Self
If true, will add SDL mappings included from https://github.com/gabomdq/SDL_GameControllerDB. Defaults to true.
pub fn set_axis_to_btn(self, pressed: f32, released: f32) -> Self
[src]
pub fn set_axis_to_btn(self, pressed: f32, released: f32) -> Self
Sets values on which ButtonPressed
and ButtonReleased
events will be emitted. build()
will return error if pressed ≤ released
or if one of values is outside [0.0, 1.0].
Defaults to 0.75 for pressed
and 0.65 for released
.
pub fn set_update_state(self, enabled: bool) -> Self
[src]
pub fn set_update_state(self, enabled: bool) -> Self
Disable or enable automatic state updates. You should use this if you use custom filters; in this case you have to update state manually anyway.
pub fn build(self) -> Result<Gilrs, Error>
[src]
pub fn build(self) -> Result<Gilrs, Error>
Creates Gilrs
.
Auto Trait Implementations
impl Send for GilrsBuilder
impl Send for GilrsBuilder
impl Sync for GilrsBuilder
impl Sync for GilrsBuilder