Enum kll_core::TriggerEvent
source · #[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
HidLed
Fields
AnalogDistance
AnalogVelocity
AnalogAcceleration
AnalogJerk
Layer
Fields
§
state: LayerStateAnimation
Fields
Sleep
Fields
Resume
Fields
Inactive
Fields
Active
Fields
Rotation
Implementations§
source§impl TriggerEvent
impl TriggerEvent
sourcepub const unsafe fn from_byte_array(bytes: [u8; 8]) -> Self
pub const unsafe fn from_byte_array(bytes: [u8; 8]) -> Self
Convert array of bytes to enum
Safety
sourcepub const unsafe fn from_bytes(bytes: &[u8]) -> Self
pub const unsafe fn from_bytes(bytes: &[u8]) -> Self
Convert slice of bytes to enum Aggressively casts the provide u8 slice to retrieve a TriggerEvent
Safety
Trait Implementations§
source§impl Clone for TriggerEvent
impl Clone for TriggerEvent
source§fn clone(&self) -> TriggerEvent
fn clone(&self) -> TriggerEvent
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for TriggerEvent
impl Debug for TriggerEvent
source§impl From<TriggerCondition> for TriggerEvent
impl From<TriggerCondition> for TriggerEvent
Convert TriggerCondition to TriggerEvent Used for mainly for kll validation, events are time index 0 and are assumed to be immediate with no history
source§fn from(cond: TriggerCondition) -> Self
fn from(cond: TriggerCondition) -> Self
Converts to this type from the input type.
source§impl From<TriggerEvent> for CapabilityRun
impl From<TriggerEvent> for CapabilityRun
source§fn from(event: TriggerEvent) -> Self
fn from(event: TriggerEvent) -> Self
Converts to this type from the input type.
source§impl From<TriggerEvent> for u8
impl From<TriggerEvent> for u8
Convert TriggerEvent into the u8 identifier
source§fn from(event: TriggerEvent) -> Self
fn from(event: TriggerEvent) -> Self
Converts to this type from the input type.