Controls

Enum Controls 

Source
#[non_exhaustive]
pub enum Controls {
Show 76 variants Connect(Box<Controller>), Disconnect, Home(bool), Prev(bool), Next(bool), ActionA(bool), ActionB(bool), ActionC(bool), ActionH(bool), ActionV(bool), Action(u16, bool), DpadUp(bool), DpadDown(bool), DpadLeft(bool), DpadRight(bool), TriggerL(f64), TriggerR(f64), BumperL(bool), BumperR(bool), JoyX(f64), JoyY(f64), JoyZ(f64), CamX(f64), CamY(f64), CamZ(f64), JoyPush(bool), CamPush(bool), PaddleRight(bool), PaddleLeft(bool), PaddleRightPinky(bool), PaddleLeftPinky(bool), AutopilotToggle(bool), LandingGearSilence(bool), PovUp(bool), PovDown(bool), PovLeft(bool), PovRight(bool), MicUp(bool), MicDown(bool), MicLeft(bool), MicRight(bool), MicPush(bool), Slew(f64), Throttle(f64), ThrottleL(f64), ThrottleR(f64), ThrottleButtonL(bool), EngineFuelFlowL(bool), EngineFuelFlowR(bool), Eac(bool), RadarAltimeter(bool), Apu(bool), AutopilotPath(bool), AutopilotAlt(bool), FlapsUp(bool), FlapsDown(bool), EngineLIgnition(bool), EngineLMotor(bool), EngineRIgnition(bool), EngineRMotor(bool), PinkyForward(bool), PinkyBackward(bool), SpeedbrakeForward(bool), SpeedbrakeBackward(bool), BoatForward(bool), BoatBackward(bool), ChinaForward(bool), ChinaBackward(bool), Dpi(bool), MouseX(f64), MouseY(f64), MousePush(bool), MouseMenu(bool), WheelX(f64), WheelY(f64), WheelPush(bool),
}
Expand description

An event from a Controller.

§Gamepad Types

§Standard Gamepad

A video game controller similar to w3c’s “standard gamepad”:

§Flightstick

A joystick typically used in flight simulations and robotics:

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.
§

Connect(Box<Controller>)

A new controller has just been plugged in.

§

Disconnect

Controller unplugged.

§

Home(bool)

Home button (Exit gameplay, usually into a console menu)

§

Prev(bool)

Back / Select / Minus / Stop Button (Escape)

§

Next(bool)

Forward / Start / Plus / Play Button (Tab)

§

ActionA(bool)

A / 1 / 4 / Circle / Return / Left Click. Action A (Main action).

§

ActionB(bool)

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

§

ActionC(bool)

C

§

ActionH(bool)

Y / X / Square / Right Click / H. Horizontal action.

§

ActionV(bool)

X / Y / Triangle / Space / V. Vertical action (Topmost action button).

§

Action(u16, bool)

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

§

DpadUp(bool)

D-pad Up

§

DpadDown(bool)

D-pad Down

§

DpadLeft(bool)

D-pad Left

§

DpadRight(bool)

D-pad Right

§

TriggerL(f64)

Range(0.0, 1.0) - Left Bumper Trigger (far button if no trigger) - “Sneak” (Ctrl)

§

TriggerR(f64)

Range(0.0, 1.0) - Right Bumper Trigger (far button if no trigger) - “Precision Action” (Alt)

§

BumperL(bool)

Left shoulder button (near button if no trigger) - “Inventory” (E)

§

BumperR(bool)

Right shoulder button (near button if no trigger) - “Use” (R)

§

JoyX(f64)

Range(-1.0, 1.0) - Main stick horizontal axis (A / D)

§

JoyY(f64)

Range(-1.0, 1.0) - Main stick vertical / depth axis (W / S)

§

JoyZ(f64)

Range(-1.0, 1.0) - Main stick rotation / yaw axis

§

CamX(f64)

Range(-1.0, 1.0) - Secondary stick X axis (Mouse X Position)

§

CamY(f64)

Range(-1.0, 1.0) - Secondary stick Y axis (Mouse Y Position)

§

CamZ(f64)

Range(-1.0, 1.0) - Secondary stick Z axis

§

JoyPush(bool)

Left Joystick Button (Middle Click)

§

CamPush(bool)

Right Joystick Button (F)

§

PaddleRight(bool)

Back right grip button (upper if there are two)

§

PaddleLeft(bool)

Back left grip button (upper if there are two)

§

PaddleRightPinky(bool)

Back lower right grip button

§

PaddleLeftPinky(bool)

Back lower left grip button

§

AutopilotToggle(bool)

Autopilot Toggle Button

§

LandingGearSilence(bool)

Landing Gear Horn Silence Button

§

PovUp(bool)

POV Hat Up

§

PovDown(bool)

POV Hat Down

§

PovLeft(bool)

POV Hat Left

§

PovRight(bool)

POV Hat Right

§

MicUp(bool)

Mic Hat Up

§

MicDown(bool)

Mic Hat Down

§

MicLeft(bool)

Mic Hat Left

§

MicRight(bool)

Mic Hat Right

§

MicPush(bool)

Mic Hat Push Button

§

Slew(f64)

Range(0.0, 1.0) - Slew Control

§

Throttle(f64)

Range(0.0, 1.0) - Stationary throttle (1.0 is forward, 0.0 is backward)

§

ThrottleL(f64)

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

§

ThrottleR(f64)

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

§

ThrottleButtonL(bool)

Left throttle button

§

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
§

Eac(bool)

EAC two-way switch

  • true - Arm
  • false - Off
§

RadarAltimeter(bool)

Radar Altimeter two-way switch

  • true - Normal
  • false - Disabled
§

Apu(bool)

APU two-way switch

  • true - Start
  • false - Off
§

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)
§

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)
§

EngineLIgnition(bool)

Left Engine Operate three-way switch Forward.

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

EngineLMotor(bool)

Left Engine Operate three-way switch Backward.

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

EngineRIgnition(bool)

Right Engine Operate three-way switch Forward.

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

EngineRMotor(bool)

Right Engine Operate three-way switch Backward.

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

PinkyForward(bool)

Pinky three-way switch Forward.

§

PinkyBackward(bool)

Pinky three-way switch Backward.

§

SpeedbrakeForward(bool)

Speedbrake three-way switch Forward.

§

SpeedbrakeBackward(bool)

Speedbrake three-way switch Backward.

§

BoatForward(bool)

Boat three-way switch Forward.

§

BoatBackward(bool)

Pinky three-way switch Backward.

§

ChinaForward(bool)

China hat three-way switch Forward.

§

ChinaBackward(bool)

China hat three-way switch Backward.

§

Dpi(bool)

DPI Switch

§

MouseX(f64)

Range(-1.0, 1.0) - Mouse delta position horizontal

§

MouseY(f64)

Range(-1.0, 1.0) - Mouse delta position vertical

§

MousePush(bool)

Left click (main click, push button)

§

MouseMenu(bool)

Right click (secondary click, push button 2)

§

WheelX(f64)

Range(-1.0, 1.0) - Scroll wheel horizontal

§

WheelY(f64)

Range(-1.0, 1.0) - Scroll wheel vertical

§

WheelPush(bool)

Middle click (scroll wheel push button)

Trait Implementations§

Source§

impl Debug for Event

Source§

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

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

impl Display for Event

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Event

§

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 T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

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

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.