pub enum EventType {
    ButtonPressed(ButtonCode),
    ButtonRepeated(ButtonCode),
    ButtonReleased(ButtonCode),
    ButtonChanged(Buttonf32Code),
    AxisChanged(Axisf32Code),
    Connected,
    Disconnected,
    Dropped,
}
Expand description

Gamepad event.

Variants

ButtonPressed(ButtonCode)

Some button on gamepad has been pressed.

ButtonRepeated(ButtonCode)

This event can be generated by ev::Repeat event filter.

ButtonReleased(ButtonCode)

Previously pressed button has been released.

ButtonChanged(Buttonf32Code)

Value of button has changed. Value can be in range [0.0, 1.0].

AxisChanged(Axisf32Code)

Value of axis has changed. Value can be in range [-1.0, 1.0].

Connected

Gamepad has been connected. If gamepad’s UUID doesn’t match one of disconnected gamepads, newly connected gamepad will get new ID.

Disconnected

Gamepad has been disconnected. Disconnected gamepad will not generate any new events.

Dropped

There was an Event, but it was dropped by one of filters. You should ignore it.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.