Event

Enum Event 

Source
pub enum Event {
Show 133 variants Timestep, Exit, Resize, Resume, Pause, Text(char), AlignLeft, AlignCenter, AlignRight, AlignJustified, EmphasisBrokenUnderline, EmphasisOverline, EmphasisBold, EmphasisInvertColor, EmphasisNone, EmphasisStrikeOut, EmphasisDoubleUnderline, EmphasisUnderline, EmphasisItalic, Select, Copy, Cancel, Delete, Find, Help, Info, Close, Open(Option<&'static str>), Share, SaveCopy, Undo, Redo, Cut, Paste, Print, Cursor(Option<(f32, f32)>), LeftButton(Option<bool>, Option<(f32, f32)>), MiddleButton(Option<bool>, Option<(f32, f32)>), RightButton(Option<bool>, Option<(f32, f32)>), Touch(Option<bool>, Option<(f32, f32)>), Scroll((f32, f32), Option<(f32, f32)>), Num1(Option<bool>), Num2(Option<bool>), Num3(Option<bool>), Num4(Option<bool>), Num5(Option<bool>), Num6(Option<bool>), Num7(Option<bool>), Num8(Option<bool>), Num9(Option<bool>), Num0(Option<bool>), Minus(Option<bool>), EqualSign(Option<bool>), Backspace(Option<bool>), Tab(Option<bool>), Q(Option<bool>), W(Option<bool>), E(Option<bool>), R(Option<bool>), T(Option<bool>), Y(Option<bool>), U(Option<bool>), I(Option<bool>), O(Option<bool>), P(Option<bool>), BracketOpen(Option<bool>), BracketClose(Option<bool>), Backslash(Option<bool>), Compose(Option<bool>), A(Option<bool>), S(Option<bool>), D(Option<bool>), F(Option<bool>), G(Option<bool>), H(Option<bool>), J(Option<bool>), K(Option<bool>), L(Option<bool>), Semicolon(Option<bool>), Apostrophe(Option<bool>), Enter(Option<bool>), LShift(Option<bool>), Z(Option<bool>), X(Option<bool>), C(Option<bool>), V(Option<bool>), B(Option<bool>), N(Option<bool>), M(Option<bool>), Comma(Option<bool>), Period(Option<bool>), Slash(Option<bool>), RShift(Option<bool>), LCtrl(Option<bool>), Alt(Option<bool>), Space(Option<bool>), RCtrl(Option<bool>), Up(Option<bool>), Down(Option<bool>), Left(Option<bool>), Right(Option<bool>), ExtBacktick(Option<bool>), ExtDelete(Option<bool>), ExtInsert(Option<bool>), ExtNumLock(Option<bool>), ExtPageUp(Option<bool>), ExtPageDown(Option<bool>), ExtHome(Option<bool>), ExtEnd(Option<bool>), ExtAsterisk(Option<bool>), ExtPlus(Option<bool>), ExtAltGr(Option<bool>), CMove(usize, f32, f32), CCamera(usize, f32, f32), CThrottleL(usize, f32), CThrottleR(usize, f32), CAccept(usize, Option<bool>), CCancel(usize, Option<bool>), CExecute(usize, Option<bool>), CAction(usize, Option<bool>), CL(usize, u8, Option<bool>), CR(usize, u8, Option<bool>), CMenu(usize, Option<bool>), CControls(usize), CExit(usize), CUp(usize, Option<bool>), CDown(usize, Option<bool>), CLeft(usize, Option<bool>), CRight(usize, Option<bool>), CMoveStick(usize, Option<bool>), CCamStick(usize, Option<bool>), CPluggedIn(usize, i32), CUnPlugged(usize, i32),
}
Expand description

Window Input Event, put on queue when an event has occurred.

Variants§

§

Timestep

Timestep event.

§

Exit

Exit event (Back key / Esc / ‘X’ button on app’s window / Ctrl-Q).

§

Resize

The window has just been resized.

§

Resume

The user has switched to this window (in focus).

§

Pause

The user has switched to a different window (out of focus).

§

Text(char)

The user has inputted text.

§

AlignLeft

Keyboard Shortcut - (CTRL-L) Align Left

§

AlignCenter

Keyboard Shortcut - (CTRL-;) Align Center

§

AlignRight

Keyboard Shortcut - (CTRL-’) Align Right

§

AlignJustified

Keyboard Shortcut - (CTRL-ENTER) Align Justified

§

EmphasisBrokenUnderline

Keyboard Shortcut - (CTRL-6) Emphasis Broken Underline

§

EmphasisOverline

Keyboard Shortcut - (CTRL-7) Emphasis Continuous Overline

§

EmphasisBold

Keyboard Shortcut - (CTRL-8) Emphasis Bold

§

EmphasisInvertColor

Keyboard Shortcut - (CTRL-9) Emphasis InvertColor

§

EmphasisNone

Keyboard Shortcut - (CTRL-0) Emphasis None

§

EmphasisStrikeOut

Keyboard Shortcut - (CTRL-MINUS) Emphasis Strike Out

§

EmphasisDoubleUnderline

Keyboard Shortcut - (CTRL-EQUALS) Emphasis Double Underline

§

EmphasisUnderline

Keyboard Shortcut - (CTRL-U) Emphasis Underline

§

EmphasisItalic

Keyboard Shortcut - (CTRL-I) Emphasis Italic

§

Select

Keyboard Shortcut - Select All (CTRL-A)

§

Copy

Keyboard Shortcut - Copy (CTRL-C)

§

Cancel

Keyboard Shortcut - Cancel (ALT-C)

§

Delete

Keyboard Shortcut - Delete (SHIFT-BACKSPACE)

§

Find

Keyboard Shortcut - Find (CTRL-F)

§

Help

Keyboard Shortcut - Help

§

Info

Keyboard Shortcut - Info

§

Close

Keyboard Shortcut - Close (Ctrl-W)

§

Open(Option<&'static str>)

Keyboard Shortcut - Open (Ctrl-O)

§

Share

Keyboard Shortcut - Share (Ctrl-S)

§

SaveCopy

Keyboard Shortcut - Save Copy (Ctrl-Shift-S)

§

Undo

Keyboard Shortcut - Undo (Ctrl-Z)

§

Redo

Keyboard Shortcut - Redo (Ctrl-Shift-Z or Ctrl-Y)

§

Cut

Keyboard Shortcut - Cut (Ctrl-X)

§

Paste

Keyboard Shortcut - Paste (Ctrl-V)

§

Print

Keyboard Shortcut - Print (Ctrl-P)

§

Cursor(Option<(f32, f32)>)

Cursor moved

§

LeftButton(Option<bool>, Option<(f32, f32)>)

Left Click (Some(Just Clicked) = Pressed, Cursor XY)

§

MiddleButton(Option<bool>, Option<(f32, f32)>)

Middle Click (or SHIFT-Click) (Some(Just Clicked) = Pressed, Cursor XY)

§

RightButton(Option<bool>, Option<(f32, f32)>)

Right Click (or CTRL-Click) (Some(Just Clicked) = Pressed, Cursor XY)

§

Touch(Option<bool>, Option<(f32, f32)>)

Touch (on a touchscreen) (Some(Just Clicked) = Pressed, Cursor XY)

§

Scroll((f32, f32), Option<(f32, f32)>)

Touchpad / Mousewheel scroll (x, y) - (-1, -1) is up / left, (1, 1) is down / right (Scroll XY, Cursor XY)

§

Num1(Option<bool>)

1

§

Num2(Option<bool>)

2

§

Num3(Option<bool>)

3

§

Num4(Option<bool>)

4

§

Num5(Option<bool>)

5

§

Num6(Option<bool>)

6

§

Num7(Option<bool>)

7

§

Num8(Option<bool>)

8

§

Num9(Option<bool>)

9

§

Num0(Option<bool>)

0

§

Minus(Option<bool>)

-

§

EqualSign(Option<bool>)

=

§

Backspace(Option<bool>)

Backspace

§

Tab(Option<bool>)

Tab

§

Q(Option<bool>)

Q

§

W(Option<bool>)

W

§

E(Option<bool>)

E

§

R(Option<bool>)

R

§

T(Option<bool>)

T

§

Y(Option<bool>)

Y

§

U(Option<bool>)

U

§

I(Option<bool>)

I

§

O(Option<bool>)

O

§

P(Option<bool>)

P

§

BracketOpen(Option<bool>)

{

§

BracketClose(Option<bool>)

}

§

Backslash(Option<bool>)

Backslash

§

Compose(Option<bool>)

Compose (CAPS LOCK)

§

A(Option<bool>)

A

§

S(Option<bool>)

S

§

D(Option<bool>)

D

§

F(Option<bool>)

F

§

G(Option<bool>)

G

§

H(Option<bool>)

H

§

J(Option<bool>)

J

§

K(Option<bool>)

K

§

L(Option<bool>)

L

§

Semicolon(Option<bool>)

;

§

Apostrophe(Option<bool>)

§

Enter(Option<bool>)

Enter

§

LShift(Option<bool>)

Left Shift

§

Z(Option<bool>)

Z

§

X(Option<bool>)

X

§

C(Option<bool>)

C

§

V(Option<bool>)

V

§

B(Option<bool>)

B

§

N(Option<bool>)

N

§

M(Option<bool>)

M

§

Comma(Option<bool>)

,

§

Period(Option<bool>)

.

§

Slash(Option<bool>)

/

§

RShift(Option<bool>)

Right Shift

§

LCtrl(Option<bool>)

Left CTRL

§

Alt(Option<bool>)

Alt (Left)

§

Space(Option<bool>)

Space

§

RCtrl(Option<bool>)

Right Control

§

Up(Option<bool>)

Up Arrow Key

§

Down(Option<bool>)

Down Arrow Key

§

Left(Option<bool>)

Left Arrow Key

§

Right(Option<bool>)

Right Arrow Key

§

ExtBacktick(Option<bool>)

`

§

ExtDelete(Option<bool>)

Delete

§

ExtInsert(Option<bool>)

Insert

§

ExtNumLock(Option<bool>)

NumLock

§

ExtPageUp(Option<bool>)

Page Up

§

ExtPageDown(Option<bool>)

Page Down

§

ExtHome(Option<bool>)

Home

§

ExtEnd(Option<bool>)

End

§

ExtAsterisk(Option<bool>)

*

§

ExtPlus(Option<bool>)

+

§

ExtAltGr(Option<bool>)

AltGr (Right Alt)

§

CMove(usize, f32, f32)

Controller: Main joystick movement.

§

CCamera(usize, f32, f32)

Controller: Camera / C joystick movement.

§

CThrottleL(usize, f32)

Controller: Left Throttle movement.

§

CThrottleR(usize, f32)

Controller: Right Throttle movement.

§

CAccept(usize, Option<bool>)

Controller: Accept (A Button / Left Top Button - Missle / Circle)

§

CCancel(usize, Option<bool>)

Controller: Cancel (B Button / Side Button / Cross)

§

CExecute(usize, Option<bool>)

Controller: Execute (X Button / Trigger / Triangle)

§

CAction(usize, Option<bool>)

Controller: Action (Y Button / Right Top Button / Square)

§

CL(usize, u8, Option<bool>)

Controller: Left Button (0: L Trigger, 1: LZ / L Bumper). 0 is farthest away from user, incrementing as buttons get closer.

§

CR(usize, u8, Option<bool>)

Controller: Right Button (0: R Trigger, 1: Z / RZ / R Bumper). 0 is farthest away from user, incrementing as buttons get closer.

§

CMenu(usize, Option<bool>)

Controller: Pause Menu (Start Button)

§

CControls(usize)

Controller: Show Controls (Guide on XBox, Select on PlayStation). Use as alternative for Menu -> “Controls”.

§

CExit(usize)

Controller: Exit This Screen (Back on XBox). Use as alternative for Menu -> “Quit” or Cancel, depending on situation.

§

CUp(usize, Option<bool>)

Controller: HAT/DPAD Up Button

§

CDown(usize, Option<bool>)

Controller: HAT/DPAD Down Button

§

CLeft(usize, Option<bool>)

Controller: Hat/D-Pad left button

§

CRight(usize, Option<bool>)

Controller: Hat/D-Pad right button.

§

CMoveStick(usize, Option<bool>)

Controller: Movement stick Push

§

CCamStick(usize, Option<bool>)

Controller: Camera stick Push

§

CPluggedIn(usize, i32)

Controller: Device Plugged-In

§

CUnPlugged(usize, i32)

Controller: Device Un-Plugged

Trait Implementations§

Source§

impl Clone for Event

Source§

fn clone(&self) -> Event

Returns a duplicate 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 Display for Event

Source§

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

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

impl PartialEq for Event

Source§

fn eq(&self, other: &Event) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for Event

Source§

impl StructuralPartialEq for Event

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

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