Enum stick::Event

source ·
#[non_exhaustive]
pub enum Event {
Show 97 variants Disconnect, Exit(bool), ActionA(bool), ActionB(bool), ActionC(bool), ActionH(bool), ActionV(bool), ActionD(bool), MenuL(bool), MenuR(bool), Joy(bool), Cam(bool), BumperL(bool), BumperR(bool), TriggerL(f64), TriggerR(f64), Up(bool), Down(bool), Left(bool), Right(bool), PovUp(bool), PovDown(bool), PovLeft(bool), PovRight(bool), HatUp(bool), HatDown(bool), HatLeft(bool), HatRight(bool), TrimUp(bool), TrimDown(bool), TrimLeft(bool), TrimRight(bool), MicUp(bool), MicDown(bool), MicLeft(bool), MicRight(bool), JoyX(f64), JoyY(f64), JoyZ(f64), CamX(f64), CamY(f64), CamZ(f64), Slew(f64), Throttle(f64), ThrottleL(f64), ThrottleR(f64), Volume(f64), Wheel(f64), Rudder(f64), Gas(f64), Brake(f64), MicPush(bool), Trigger(bool), Bumper(bool), ActionM(bool), ActionL(bool), ActionR(bool), Pinky(bool), PinkyForward(bool), PinkyBackward(bool), FlapsUp(bool), FlapsDown(bool), BoatForward(bool), BoatBackward(bool), AutopilotPath(bool), AutopilotAlt(bool), EngineMotorL(bool), EngineMotorR(bool), EngineFuelFlowL(bool), EngineFuelFlowR(bool), EngineIgnitionL(bool), EngineIgnitionR(bool), SpeedbrakeBackward(bool), SpeedbrakeForward(bool), ChinaBackward(bool), ChinaForward(bool), Apu(bool), RadarAltimeter(bool), LandingGearSilence(bool), Eac(bool), AutopilotToggle(bool), ThrottleButton(bool), MouseX(f64), MouseY(f64), Mouse(bool), Number(i8, bool), PaddleLeft(bool), PaddleRight(bool), PinkyLeft(bool), PinkyRight(bool), Context(bool), Dpi(bool), ScrollX(f64), ScrollY(f64), Scroll(bool), ActionWheelX(f64), ActionWheelY(f64),
}
Expand description

An event from a Controller.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Disconnect

Controller unplugged.

§

Exit(bool)

Exit / Main / Home / Mode

§

ActionA(bool)

A / 1 / 4 / Circle. Action A (Primary action).

§

ActionB(bool)

B / 2 / 3 / Cross. Action B (Secondary action).

§

ActionC(bool)

C. Action C (Tertiary action).

§

ActionH(bool)

Y / X / Square. Action H (Horizontal action).

§

ActionV(bool)

X / Y / Triangle. Action V (Vertical action).

§

ActionD(bool)

Z (in 6-button layout). Action D.

§

MenuL(bool)

Left Menu / Back / Select / Minus / Stop

§

MenuR(bool)

Right Menu / Forward / Start / Plus / Play

§

Joy(bool)

Thumb Push Button On Main / Left Joystick

§

Cam(bool)

Thumb Push Button On Camera / Right Joystick

§

BumperL(bool)

Left shoulder button (near button if no trigger)

§

BumperR(bool)

Right shoulder button (near button if no trigger)

§

TriggerL(f64)

Left Bumper Trigger (far button if no trigger) - between 0.0 and 1.0

§

TriggerR(f64)

Right Bumper Trigger (far button if no trigger) - between 0.0 and 1.0

§

Up(bool)

D-Pad Up

§

Down(bool)

D-Pad Down

§

Left(bool)

D-Pad Left

§

Right(bool)

D-Pad Right

§

PovUp(bool)

POV/Main Hat Left

§

PovDown(bool)

POV/Main Hat Down

§

PovLeft(bool)

POV/Main Hat Left

§

PovRight(bool)

POV/Main Hat Right

§

HatUp(bool)

Extra Hat Up

§

HatDown(bool)

Extra Hat Down

§

HatLeft(bool)

Extra Hat Left

§

HatRight(bool)

Extra Hat Right

§

TrimUp(bool)

Trim Hat Up

§

TrimDown(bool)

Trim Hat Down

§

TrimLeft(bool)

Trim Hat Left

§

TrimRight(bool)

Trim Hat Right

§

MicUp(bool)

Mic Hat Up

§

MicDown(bool)

Mic Hat Down

§

MicLeft(bool)

Mic Hat Left

§

MicRight(bool)

Mic Hat Right

§

JoyX(f64)

Main stick horizontal axis (A / D) - between -1.0 and 1.0

§

JoyY(f64)

Main stick vertical / depth axis (W / S) - between -1.0 and 1.0

§

JoyZ(f64)

Main stick rotation / yaw axis - between -1.0 and 1.0

§

CamX(f64)

Secondary stick X axis (Mouse X Position) - between -1.0 and 1.0

§

CamY(f64)

Secondary stick Y axis (Mouse Y Position) - between -1.0 and 1.0

§

CamZ(f64)

Secondary stick Z axis - between -1.0 and 1.0

§

Slew(f64)

Slew Control - between 0.0 and 1.0

§

Throttle(f64)

Stationary throttle (0.0 is forward, 1.0 is backward)

§

ThrottleL(f64)

Left stationary throttle (0.0 is forward, 1.0 is backward)

§

ThrottleR(f64)

Right stationary throttle (0.0 is forward, 1.0 is backward)

§

Volume(f64)

Volume axis (0.0 is off, 1.0 is full volume)

§

Wheel(f64)

Steering wheel - between 0.0 and 1.0

§

Rudder(f64)

Ship rudder - between 0.0 and 1.0

§

Gas(f64)

Gas Pedal - between 0.0 and 1.0

§

Brake(f64)

Brake Pedal - between 0.0 and 1.0

§

MicPush(bool)

Mic Hat Push Button

§

Trigger(bool)

Flightstick trigger button on the back.

§

Bumper(bool)

Flightstick Side Bumper Button

§

ActionM(bool)

Flightstick Top Middle Action Button

§

ActionL(bool)

Flightstick Top Left Action Button

§

ActionR(bool)

Flightstick Top Right Action Button

§

Pinky(bool)

Pinky Button

§

PinkyForward(bool)

Pinky three-way switch Forward.

§

PinkyBackward(bool)

Pinky three-way switch Backward.

§

FlapsUp(bool)

Flaps three-way switch Forward.

  • true - Forward (Up)
  • false - Neutral (Maneuver)
§

FlapsDown(bool)

Flaps three-way switch Backward.

  • true - Backward (Down)
  • false - Neutral (Maneuver)
§

BoatForward(bool)

Boat three-way switch Forward.

§

BoatBackward(bool)

Boat three-way switch Backward.

§

AutopilotPath(bool)

Autopilot three-way switch Forward.

  • true - Forward (Path)
  • false - Neutral (Altitude / Heading)
§

AutopilotAlt(bool)

Autopilot three-way switch Backward.

  • true - Backward (Alt)
  • false - Neutral (Altitude / Heading)
§

EngineMotorL(bool)

Left Engine Operate three-way switch Backward.

  • true - Backward (Motor)
  • false - Neutral (Normal)
§

EngineMotorR(bool)

Right Engine Operate three-way switch Backward.

  • true - Backward (Motor)
  • false - Neutral (Normal)
§

EngineFuelFlowL(bool)

Engine Fuel Flow Left two-way switch

  • true - Normal
  • false - Override
§

EngineFuelFlowR(bool)

Engine Fuel Flow Right two-way switch

  • true - Normal
  • false - Override
§

EngineIgnitionL(bool)

Left Engine Operate three-way switch Forward.

  • true - Forward (Ignition)
  • false - Neutral (Normal)
§

EngineIgnitionR(bool)

Right Engine Operate three-way switch Forward.

  • true - Forward (Ignition)
  • false - Neutral (Normal)
§

SpeedbrakeBackward(bool)

Speedbrake three-way switch Backward.

§

SpeedbrakeForward(bool)

Speedbrake three-way switch Forward.

§

ChinaBackward(bool)

China hat three-way switch Backward.

§

ChinaForward(bool)

China hat three-way switch Forward.

§

Apu(bool)

APU (Auxiliary Power Unit) two-way switch

  • true - Start
  • false - Off
§

RadarAltimeter(bool)

Radar Altimeter two-way switch (Altitude measurements)

  • true - Normal
  • false - Disabled
§

LandingGearSilence(bool)

Landing Gear Horn Silence Button

§

Eac(bool)

EAC (Enhanced Attitude Control - Autopilot) two-way switch

  • true - Arm
  • false - Off
§

AutopilotToggle(bool)

Autopilot Toggle Button

§

ThrottleButton(bool)

Throttle button (Left)

§

MouseX(f64)

Mouse delta position horizontal - between -1.0 and 1.0

§

MouseY(f64)

Mouse delta position vertical - between -1.0 and 1.0

§

Mouse(bool)

Mouse primary button

§

Number(i8, bool)

Numbered or unlabeled programmable action buttons (If unlabelled, prefer numbering from left to right, upper to lower)

§

PaddleLeft(bool)

Back left grip button (upper if there are two)

§

PaddleRight(bool)

Back right grip button (upper if there are two)

§

PinkyLeft(bool)

Left Pinky Button / Back lower right grip button

§

PinkyRight(bool)

Right Pinky Button / Back lower left grip button

§

Context(bool)

Context Menu Button on a mouse (Right Click)

§

Dpi(bool)

DPI Button on a mouse

§

ScrollX(f64)

Scroll Wheel X on a mouse - between -1.0 and 1.0

§

ScrollY(f64)

Scroll Wheel Y on a mouse - between -1.0 and 1.0

§

Scroll(bool)

Scroll Button on a mouse

§

ActionWheelX(f64)

Horizontal axis under the action buttons - between -1.0 and 1.0

§

ActionWheelY(f64)

Vertical axis under the action buttons - between -1.0 and 1.0

Trait Implementations§

source§

impl Clone for Event

source§

fn clone(&self) -> Event

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for Event

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Event

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for Event

Auto Trait Implementations§

§

impl RefUnwindSafe for Event

§

impl Send for Event

§

impl Sync for Event

§

impl Unpin for Event

§

impl UnwindSafe for Event

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.