pub struct InputController { /* private fields */ }Implementations§
Source§impl InputController
impl InputController
pub fn new() -> Self
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 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 axis(&self, name: &str) -> Option<Scalar>
pub fn axis_or_default(&self, name: &str) -> Scalar
pub fn set_axis(&mut self, name: &str, value: Scalar)
pub fn trigger(&self, name: &str) -> Option<TriggerState>
pub fn trigger_or_default(&self, name: &str) -> TriggerState
pub fn set_trigger(&mut self, name: &str, value: TriggerState)
pub fn process(&mut self)
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
Source§impl<T> TryDefault for Twhere
T: Default,
impl<T> TryDefault for Twhere
T: Default,
Source§fn try_default() -> Result<T, String>
fn try_default() -> Result<T, String>
Tries to create the default.
Source§fn unwrap_default() -> Self
fn unwrap_default() -> Self
Calls
try_default and panics on an error case.