[][src]Enum amethyst_input::InputEvent

pub enum InputEvent<T> where
    T: BindingTypes
{ KeyPressed { key_code: VirtualKeyCode, scancode: u32, }, KeyReleased { key_code: VirtualKeyCode, scancode: u32, }, KeyTyped(char), MouseButtonPressed(MouseButton), MouseButtonReleased(MouseButton), ButtonPressed(Button), ButtonReleased(Button), CursorMoved { delta_x: f32, delta_y: f32, }, MouseMoved { delta_x: f32, delta_y: f32, }, MouseWheelMoved(ScrollDirection), AxisMoved { axis: T::Axis, value: f32, }, ControllerAxisMoved { which: u32, axis: ControllerAxis, value: f32, }, ControllerButtonPressed { which: u32, button: ControllerButton, }, ControllerButtonReleased { which: u32, button: ControllerButton, }, ControllerConnected { which: u32, }, ControllerDisconnected { which: u32, }, ActionPressed(T::Action), ActionReleased(T::Action), ActionWheelMoved(T::Action), }

Events generated by the input system

Type parameter T is the type assigned to your Actions for your InputBundle or InputHandler.

Variants

KeyPressed

A key was pressed down, sent exactly once per key press.

Fields of KeyPressed

key_code: VirtualKeyCode

VirtualKeyCode, used for semantic info. i.e. "W" was pressed

scancode: u32

Scancode, used for positional info. i.e. The third key on the first row was pressed.

KeyReleased

A key was released, sent exactly once per key release.

Fields of KeyReleased

key_code: VirtualKeyCode

VirtualKeyCode, used for semantic info. i.e. "W" was released

scancode: u32

Scancode, used for positional info. i.e. The third key on the first row was released.

KeyTyped(char)

A unicode character was received by the window. Good for typing.

MouseButtonPressed(MouseButton)

A mouse button was pressed down, sent exactly once per press.

MouseButtonReleased(MouseButton)

A mouse button was released, sent exactly once per release.

ButtonPressed(Button)

A button was pressed.

ButtonReleased(Button)

A button was released.

CursorMoved

The mouse pointer moved on screen

Fields of CursorMoved

delta_x: f32

The amount the cursor moved horizontally in pixels.

delta_y: f32

The amount the cursor moved vertically in pixels.

MouseMoved

The mouse device moved. Use this for any use of the mouse that doesn't involve a standard mouse pointer.

Fields of MouseMoved

delta_x: f32

The amount the mouse moved horizontally.

delta_y: f32

The amount the mouse moved vertically.

MouseWheelMoved(ScrollDirection)

The mousewheel was moved in either direction

AxisMoved

An axis value changed.

Note that this variant is used for BindingTypes::Axis, not a ControllerAxis.

Fields of AxisMoved

axis: T::Axis

The axis that moved on the controller.

value: f32

The amount that the axis moved.

ControllerAxisMoved

A controller Axis was moved.

Note that this variant is used for a ControllerAxis, not BindingTypes::Axis.

Fields of ControllerAxisMoved

which: u32

The id for the controller whose axis moved.

axis: ControllerAxis

The axis that moved on the controller.

value: f32

The amount that the axis moved.

ControllerButtonPressed

A controller button was pressed.

Fields of ControllerButtonPressed

which: u32

The id for the controller whose button was pressed.

button: ControllerButton

The button that was pressed.

ControllerButtonReleased

A controller button was released.

Fields of ControllerButtonReleased

which: u32

The id for the controller whose button was released.

button: ControllerButton

The button that was released.

ControllerConnected

New controller was connected.

Fields of ControllerConnected

which: u32

The id for the controller connected.

ControllerDisconnected

Controller was disconnected, its id might be reused later.

Fields of ControllerDisconnected

which: u32

The id for the controller disconnected.

ActionPressed(T::Action)

The associated action had any related button or combination pressed.

If a combination is bound to an action, it will be pressed if all buttons within are pressed.

ActionReleased(T::Action)

The associated action had any related button or combination released.

If a combination is bound to an action, it will be released if any of the buttons within is released while all others are pressed.

ActionWheelMoved(T::Action)

The associated action has its mouse wheel moved.

Trait Implementations

impl<T> Clone for InputEvent<T> where
    T: BindingTypes
[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<T: PartialEq> PartialEq<InputEvent<T>> for InputEvent<T> where
    T: BindingTypes,
    T::Axis: PartialEq,
    T::Action: PartialEq,
    T::Action: PartialEq,
    T::Action: PartialEq
[src]

impl<'a, T> Into<InputEvent<T>> for &'a ControllerEvent where
    T: BindingTypes
[src]

impl<T: Debug> Debug for InputEvent<T> where
    T: BindingTypes,
    T::Axis: Debug,
    T::Action: Debug,
    T::Action: Debug,
    T::Action: Debug
[src]

impl<'de, T> Deserialize<'de> for InputEvent<T> where
    T: BindingTypes,
    T::Axis: Deserialize<'de>,
    T::Action: Deserialize<'de>,
    T::Action: Deserialize<'de>,
    T::Action: Deserialize<'de>, 
[src]

impl<T> Serialize for InputEvent<T> where
    T: BindingTypes,
    T::Axis: Serialize,
    T::Action: Serialize,
    T::Action: Serialize,
    T::Action: Serialize
[src]

Auto Trait Implementations

impl<T> Unpin for InputEvent<T> where
    <T as BindingTypes>::Action: Unpin,
    <T as BindingTypes>::Axis: Unpin

impl<T> Sync for InputEvent<T> where
    <T as BindingTypes>::Action: Sync,
    <T as BindingTypes>::Axis: Sync

impl<T> Send for InputEvent<T> where
    <T as BindingTypes>::Action: Send,
    <T as BindingTypes>::Axis: Send

impl<T> UnwindSafe for InputEvent<T> where
    <T as BindingTypes>::Action: UnwindSafe,
    <T as BindingTypes>::Axis: UnwindSafe

impl<T> RefUnwindSafe for InputEvent<T> where
    <T as BindingTypes>::Action: RefUnwindSafe,
    <T as BindingTypes>::Axis: RefUnwindSafe

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> SetParameter for T[src]

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 
[src]

Sets value as a parameter of self.

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 
[src]

impl<T> Resource for T where
    T: Any + Send + Sync
[src]

impl<T> Any for T where
    T: Any
[src]

impl<T> Event for T where
    T: Send + Sync + 'static, 
[src]