[−][src]Trait spectrusty::bus::joystick::JoystickInterface
An interface for providing user input data for a JoystickDevice implementation.
Required methods
pub fn fire(&mut self, btn: u8, pressed: bool)
[src]
Press or release a "fire" button. btn
is the button number for cases when the joystick have more
than one button.
Currently, btn
is not being used by any of the implemented devices.
pub fn get_fire(&self, btn: u8) -> bool
[src]
Returns true
if an indicated "fire" button is being pressed, otherwise returns false
.
pub fn set_directions(&mut self, dir: Directions)
[src]
Changes the stick direction using provided flags.
pub fn get_directions(&self) -> Directions
[src]
Returns the current stick direction.
Provided methods
pub fn direction(&mut self, dir: JoyDirection)
[src]
Changes the stick direction using an enum.
pub fn center(&mut self)
[src]
Resets a joystick to a central (neutral) position.
pub fn is_up(&self) -> bool
[src]
Returns true
if a joystick is in the up (forward) position.
pub fn is_right(&self) -> bool
[src]
Returns true
if a joystick is in the right position.
pub fn is_left(&self) -> bool
[src]
Returns true
if a joystick is in the left position.
pub fn is_down(&self) -> bool
[src]
Returns true
if a joystick is in the down (backward) position.
pub fn is_center(&self) -> bool
[src]
Returns true
if a joystick is in the center (neutral) position.
Implementors
impl JoystickInterface for CursorJoystickDevice
[src]
pub fn fire(&mut self, _btn: u8, pressed: bool)
[src]
pub fn get_fire(&self, _btn: u8) -> bool
[src]
pub fn set_directions(&mut self, dir: Directions)
[src]
pub fn get_directions(&self) -> Directions
[src]
impl JoystickInterface for FullerJoystickDevice
[src]
pub fn fire(&mut self, _btn: u8, pressed: bool)
[src]
pub fn get_fire(&self, _btn: u8) -> bool
[src]
pub fn set_directions(&mut self, dir: Directions)
[src]
pub fn get_directions(&self) -> Directions
[src]
impl JoystickInterface for KempstonJoystickDevice
[src]
pub fn fire(&mut self, _btn: u8, pressed: bool)
[src]
pub fn get_fire(&self, _btn: u8) -> bool
[src]
pub fn set_directions(&mut self, dir: Directions)
[src]
pub fn get_directions(&self) -> Directions
[src]
impl JoystickInterface for NullJoystickDevice
[src]
pub fn fire(&mut self, _btn: u8, _pressed: bool)
[src]
pub fn get_fire(&self, _btn: u8) -> bool
[src]
pub fn set_directions(&mut self, _dir: Directions)
[src]
pub fn get_directions(&self) -> Directions
[src]
impl<S> JoystickInterface for SinclairJoystickDevice<S> where
S: SinclairJoyKeyMap,
[src]
S: SinclairJoyKeyMap,