[−][src]Struct beryllium::Controller
Handle to a window on the screen.
Methods
impl<'sdl> Controller<'sdl>
[src]
pub fn mapping_string(&self) -> Option<String>
[src]
Obtains the mapping string, if available.
pub fn name(&self) -> Option<String>
[src]
The implementation defined name for this controller.
pub fn is_attached(&self) -> bool
[src]
Checks that the controller is currently connected.
pub fn axis(&self, axis: ControllerAxis) -> i16
[src]
Gives the axis value of the specified axis.
- Sticks: negative to positive
- Triggers: zero to positive
Also gives 0 on failure. You could call get_error if you want.
pub fn button(&self, button: ControllerButton) -> bool
[src]
Gives if the given button is pressed.
Note that this returns false
for not-pressed but also if there's some
sort of error. You can call get_error if you really want.
pub fn joystick_id(&self) -> Result<JoystickID, String>
[src]
Attempts to get the joystick ID of this controller.
Trait Implementations
impl<'sdl> Drop for Controller<'sdl>
[src]
impl<'sdl> Debug for Controller<'sdl>
[src]
Auto Trait Implementations
impl<'sdl> !Send for Controller<'sdl>
impl<'sdl> Unpin for Controller<'sdl>
impl<'sdl> !Sync for Controller<'sdl>
impl<'sdl> UnwindSafe for Controller<'sdl>
impl<'sdl> RefUnwindSafe for Controller<'sdl>
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,