pub struct PadInput { /* private fields */ }Expand description
Every connected controller, polled once per frame.
Implementations§
Source§impl PadInput
impl PadInput
Sourcepub fn new(stick: StickDef) -> Self
pub fn new(stick: StickDef) -> Self
Starts watching for controllers; stick is the keymap’s stick
thresholds. If the platform’s controller support can’t start, the
game runs without controllers.
Sourcepub fn poll(&mut self, focused: bool) -> Vec<RawInputEvent>
pub fn poll(&mut self, focused: bool) -> Vec<RawInputEvent>
This frame’s controller button releases, then presses, while the
window has focus if focused (pad_events). Pads plugged in or
removed since the last frame are picked up here.
Auto Trait Implementations§
impl !Sync for PadInput
impl Freeze for PadInput
impl RefUnwindSafe for PadInput
impl Send for PadInput
impl Unpin for PadInput
impl UnsafeUnpin for PadInput
impl UnwindSafe for PadInput
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