[][src]Struct gilrs::GilrsBuilder

pub struct GilrsBuilder { /* fields omitted */ }

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

Blanket Implementations

impl<T> From for T[src]

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

impl<T, U> TryFrom for T where
    U: Into<T>, 
[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.