#[repr(u8)]
pub enum TriggerEvent {
Show 14 variants None, Switch { state: Phro, index: u16, last_state: u32, }, HidLed { state: Aodo, index: u8, last_state: u32, }, AnalogDistance { index: u16, val: i16, }, AnalogVelocity { index: u16, val: i16, }, AnalogAcceleration { index: u16, val: i16, }, AnalogJerk { index: u16, val: i16, }, Layer { state: LayerState, layer: u8, last_state: u32, }, Animation { state: Dro, index: u16, last_state: u32, }, Sleep { state: Aodo, last_state: u32, }, Resume { state: Aodo, last_state: u32, }, Inactive { state: Aodo, last_state: u32, }, Active { state: Aodo, last_state: u32, }, Rotation { index: u8, position: i8, last_state: u32, },
}
Expand description

Trigger event definitions

last_state is an incrementing counter that increases on every scan loop while the state has not changed (e.g. holding a key).

Variants

None

Switch

Fields

state: Phro

Switch state

index: u16

Switch identification index

last_state: u32

Scanning loops since the last state change (can be 0 if the state just changed)

HidLed

Fields

state: Aodo

LED state

index: u8

HID LED identification (from USB HID spec, e.g. CapsLock)

last_state: u32

Scanning loops since the last state change (can be 0 if the state just changed)

AnalogDistance

Fields

index: u16
val: i16

AnalogVelocity

Fields

index: u16
val: i16

AnalogAcceleration

Fields

index: u16
val: i16

AnalogJerk

Fields

index: u16
val: i16

Layer

Fields

state: LayerState
layer: u8
last_state: u32

Scanning loops since the last state change (can be 0 if the state just changed)

Animation

Fields

state: Dro
index: u16
last_state: u32

Scanning loops since the last state change (can be 0 if the state just changed)

Sleep

Fields

state: Aodo
last_state: u32

Scanning loops since the last state change (can be 0 if the state just changed)

Resume

Fields

state: Aodo
last_state: u32

Scanning loops since the last state change (can be 0 if the state just changed)

Inactive

Fields

state: Aodo
last_state: u32

Scanning loops since the last state change (can be 0 if the state just changed)

Active

Fields

state: Aodo
last_state: u32

Scanning loops since the last state change (can be 0 if the state just changed)

Rotation

Fields

index: u8
position: i8
last_state: u32

Scanning loops since the last state change (can be 0 if the state just changed)

Implementations

Convert enum to an array of bytes

Safety

Convert array of bytes to enum

Safety

Convert slice of bytes to enum Aggressively casts the provide u8 slice to retrieve a TriggerEvent

Safety

Attempts to determine the index value of the event If an index is not valid, return 0 instead (index may not have any meaning)

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

Writes the defmt representation of self to fmt.

Convert TriggerCondition to TriggerEvent Used for mainly for kll validation, events are time index 0 and are assumed to be immediate with no history

Converts to this type from the input type.

Converts to this type from the input type.

Convert TriggerEvent into the u8 identifier

Converts to this type from the input type.

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

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

This method tests for !=.

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