[][src]Trait spectrusty::bus::joystick::JoystickInterface

pub trait JoystickInterface {
    pub fn fire(&mut self, btn: u8, pressed: bool);
pub fn get_fire(&self, btn: u8) -> bool;
pub fn set_directions(&mut self, dir: Directions);
pub fn get_directions(&self) -> Directions; pub fn direction(&mut self, dir: JoyDirection) { ... }
pub fn center(&mut self) { ... }
pub fn is_up(&self) -> bool { ... }
pub fn is_right(&self) -> bool { ... }
pub fn is_left(&self) -> bool { ... }
pub fn is_down(&self) -> bool { ... }
pub fn is_center(&self) -> bool { ... } }

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.

Loading content...

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.

Loading content...

Implementors

impl JoystickInterface for CursorJoystickDevice[src]

impl JoystickInterface for FullerJoystickDevice[src]

impl JoystickInterface for KempstonJoystickDevice[src]

impl JoystickInterface for NullJoystickDevice[src]

impl<S> JoystickInterface for SinclairJoystickDevice<S> where
    S: SinclairJoyKeyMap
[src]

Loading content...