Enum sdl2::joystick::HatState [] [src]

pub enum HatState {
    Centered,
    Up,
    Right,
    Down,
    Left,
    RightUp,
    RightDown,
    LeftUp,
    Leftdown,
}

This is represented in SDL2 as a bitfield but obviously not all combinations make sense: 5 for instance would mean up and down at the same time... To simplify things I turn it into an enum which is how the SDL2 docs present it anyway (using macros).

Variants

Centered
Up
Right
Down
Left
RightUp
RightDown
LeftUp
Leftdown

Methods

impl HatState

fn from_raw(raw: u8) -> HatState

Trait Implementations

Derived Implementations

impl Debug for HatState

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl Hash for HatState

fn hash<__H: Hasher>(&self, __arg_0: &mut __H)

fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher

impl PartialEq for HatState

fn eq(&self, __arg_0: &HatState) -> bool

fn ne(&self, __arg_0: &HatState) -> bool

impl Eq for HatState

impl Clone for HatState

fn clone(&self) -> HatState

fn clone_from(&mut self, source: &Self)

impl Copy for HatState