[−][src]Struct gilrs::GilrsBuilder
Allow to create Gilrs
with customized behaviour.
Methods
impl GilrsBuilder
[src]
pub fn new() -> Self
[src]
Create builder with default settings. Use build()
to create Gilrs
.
pub fn with_default_filters(self, default_filters: bool) -> Self
[src]
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]
Adds SDL mappings.
pub fn add_env_mappings(self, env_mappings: bool) -> Self
[src]
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]
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]
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]
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]
Creates Gilrs
.
Auto Trait Implementations
impl Send for GilrsBuilder
impl Sync for GilrsBuilder
impl Unpin for GilrsBuilder
impl UnwindSafe for GilrsBuilder
impl RefUnwindSafe for GilrsBuilder
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,