pub struct InputController { /* private fields */ }
Implementations§
Source§impl InputController
impl InputController
pub fn register<D>(&mut self, device: D)where
D: InputDevice + 'static,
pub fn unregister(&mut self, name: &str) -> Option<Box<dyn InputDevice>>
pub fn device(&self, id: &str) -> Option<&dyn InputDevice>
pub fn as_device<T>(&self, id: &str) -> Option<&T>where
T: InputDevice,
pub fn mapping_axes(&self) -> impl Iterator<Item = (&str, (&str, &str))>
pub fn mapping_triggers(&self) -> impl Iterator<Item = (&str, (&str, &str))>
pub fn map_config(&mut self, config: InputMappings)
pub fn map_axis(&mut self, name_from: &str, device: &str, name_to: &str)
pub fn unmap_axis(&mut self, name: &str)
pub fn map_trigger(&mut self, name_from: &str, device: &str, name_to: &str)
pub fn unmap_trigger(&mut self, name: &str)
pub fn axes(&self) -> impl Iterator<Item = (&str, Scalar)>
pub fn triggers(&self) -> impl Iterator<Item = (&str, TriggerState)>
pub fn axis(&self, name: &str) -> Option<Scalar>
pub fn multi_axis<const N: usize>( &self, names: [&str; N], ) -> [Option<Scalar>; N]
pub fn mirror_multi_axis<const N: usize>( &self, names: [(&str, &str); N], ) -> [Option<Scalar>; N]
pub fn axis_or_default(&self, name: &str) -> Scalar
pub fn multi_axis_or_default<const N: usize>( &self, names: [&str; N], ) -> [Scalar; N]
pub fn mirror_multi_axis_or_default<const N: usize>( &self, names: [(&str, &str); N], ) -> [Scalar; N]
pub fn set_axis(&mut self, name: &str, value: Scalar)
pub fn trigger(&self, name: &str) -> Option<TriggerState>
pub fn multi_trigger<const N: usize>( &self, names: [&str; N], ) -> [Option<TriggerState>; N]
pub fn priority_trigger<const N: usize>( &self, names: [&str; N], ) -> Option<TriggerState>
pub fn trigger_or_default(&self, name: &str) -> TriggerState
pub fn multi_trigger_or_default<const N: usize>( &self, names: [&str; N], ) -> [TriggerState; N]
pub fn priority_trigger_or_default<const N: usize>( &self, names: [&str; N], ) -> TriggerState
pub fn set_trigger(&mut self, name: &str, value: TriggerState)
pub fn text(&self) -> &str
pub fn process(&mut self, universe: &mut Universe)
Trait Implementations§
Source§impl Default for InputController
impl Default for InputController
Source§fn default() -> InputController
fn default() -> InputController
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for InputController
impl !RefUnwindSafe for InputController
impl Send for InputController
impl Sync for InputController
impl Unpin for InputController
impl !UnwindSafe for InputController
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more