pub struct InputController { /* private fields */ }

Implementations§

source§

impl InputController

source

pub fn register<D>(&mut self, device: D)where D: InputDevice + 'static,

source

pub fn unregister(&mut self, name: &str) -> Option<Box<dyn InputDevice>>

source

pub fn device(&self, id: &str) -> Option<&dyn InputDevice>

source

pub fn as_device<T>(&self, id: &str) -> Option<&T>where T: InputDevice,

source

pub fn mapping_axes(&self) -> impl Iterator<Item = (&str, (&str, &str))>

source

pub fn mapping_triggers(&self) -> impl Iterator<Item = (&str, (&str, &str))>

source

pub fn map_config(&mut self, config: InputMappings)

source

pub fn map_axis(&mut self, name_from: &str, device: &str, name_to: &str)

source

pub fn unmap_axis(&mut self, name: &str)

source

pub fn map_trigger(&mut self, name_from: &str, device: &str, name_to: &str)

source

pub fn unmap_trigger(&mut self, name: &str)

source

pub fn axes(&self) -> impl Iterator<Item = (&str, Scalar)>

source

pub fn triggers(&self) -> impl Iterator<Item = (&str, TriggerState)>

source

pub fn axis(&self, name: &str) -> Option<Scalar>

source

pub fn multi_axis<const N: usize>( &self, names: [&str; N] ) -> [Option<Scalar>; N]

source

pub fn mirror_multi_axis<const N: usize>( &self, names: [(&str, &str); N] ) -> [Option<Scalar>; N]

source

pub fn axis_or_default(&self, name: &str) -> Scalar

source

pub fn multi_axis_or_default<const N: usize>( &self, names: [&str; N] ) -> [Scalar; N]

source

pub fn mirror_multi_axis_or_default<const N: usize>( &self, names: [(&str, &str); N] ) -> [Scalar; N]

source

pub fn set_axis(&mut self, name: &str, value: Scalar)

source

pub fn trigger(&self, name: &str) -> Option<TriggerState>

source

pub fn multi_trigger<const N: usize>( &self, names: [&str; N] ) -> [Option<TriggerState>; N]

source

pub fn priority_trigger<const N: usize>( &self, names: [&str; N] ) -> Option<TriggerState>

source

pub fn trigger_or_default(&self, name: &str) -> TriggerState

source

pub fn multi_trigger_or_default<const N: usize>( &self, names: [&str; N] ) -> [TriggerState; N]

source

pub fn priority_trigger_or_default<const N: usize>( &self, names: [&str; N] ) -> TriggerState

source

pub fn set_trigger(&mut self, name: &str, value: TriggerState)

source

pub fn text(&self) -> &str

source

pub fn process(&mut self, universe: &mut Universe)

Trait Implementations§

source§

impl Default for InputController

source§

fn default() -> InputController

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Finalize for T

§

unsafe fn finalize_raw(data: *mut ())

Safety Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Initialize for Twhere T: Default,

§

fn initialize(&mut self)

§

unsafe fn initialize_raw(data: *mut ())

Safety Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Component for Twhere T: Send + Sync + 'static,