#[repr(u8)]pub enum TriggerEvent {
Show 14 variants
None = 0,
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 = 0
Switch
Fields
HidLed
Fields
AnalogDistance
AnalogVelocity
AnalogAcceleration
AnalogJerk
Layer
Fields
§
state: LayerState
Animation
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 duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const 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
Convert TriggerCondition to TriggerEvent
Used for mainly for kll validation, events are time index 0
and are assumed to be immediate with no history
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
Convert TriggerEvent into the u8 identifier
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.
Source§impl Hash for TriggerEvent
impl Hash for TriggerEvent
Source§impl PartialEq for TriggerEvent
impl PartialEq for TriggerEvent
impl Copy for TriggerEvent
impl Eq for TriggerEvent
impl StructuralPartialEq for TriggerEvent
Auto Trait Implementations§
impl Freeze for TriggerEvent
impl RefUnwindSafe for TriggerEvent
impl Send for TriggerEvent
impl Sync for TriggerEvent
impl Unpin for TriggerEvent
impl UnwindSafe for TriggerEvent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more