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
state: PhroSwitch state
index: u16Switch identification index
last_state: u32Scanning loops since the last state change (can be 0 if the state just changed)
HidLed
Fields
state: AodoLED state
index: u8HID LED identification (from USB HID spec, e.g. CapsLock)
last_state: u32Scanning loops since the last state change (can be 0 if the state just changed)
AnalogDistance
AnalogVelocity
AnalogAcceleration
AnalogJerk
Layer
Fields
state: LayerStatelayer: u8last_state: u32Scanning loops since the last state change (can be 0 if the state just changed)
Animation
Fields
state: Droindex: u16last_state: u32Scanning loops since the last state change (can be 0 if the state just changed)
Sleep
Fields
state: Aodolast_state: u32Scanning loops since the last state change (can be 0 if the state just changed)
Resume
Fields
state: Aodolast_state: u32Scanning loops since the last state change (can be 0 if the state just changed)
Inactive
Fields
state: Aodolast_state: u32Scanning loops since the last state change (can be 0 if the state just changed)
Active
Fields
state: Aodolast_state: u32Scanning loops since the last state change (can be 0 if the state just changed)
Rotation
Fields
index: u8position: i8last_state: u32Scanning loops since the last state change (can be 0 if the state just changed)
Implementations
sourceimpl TriggerEvent
impl TriggerEvent
Trait Implementations
sourceimpl Clone for TriggerEvent
impl Clone for TriggerEvent
sourcefn clone(&self) -> TriggerEvent
fn clone(&self) -> TriggerEvent
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for TriggerEvent
impl Debug for TriggerEvent
sourceimpl Format for TriggerEvent
impl Format for TriggerEvent
sourceimpl 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
sourcefn from(cond: TriggerCondition) -> Self
fn from(cond: TriggerCondition) -> Self
Converts to this type from the input type.
sourceimpl From<TriggerEvent> for CapabilityRun
impl From<TriggerEvent> for CapabilityRun
sourcefn from(event: TriggerEvent) -> Self
fn from(event: TriggerEvent) -> Self
Converts to this type from the input type.
sourceimpl From<TriggerEvent> for u8
impl From<TriggerEvent> for u8
Convert TriggerEvent into the u8 identifier
sourcefn from(event: TriggerEvent) -> Self
fn from(event: TriggerEvent) -> Self
Converts to this type from the input type.
sourceimpl Hash for TriggerEvent
impl Hash for TriggerEvent
sourceimpl PartialEq<TriggerEvent> for TriggerEvent
impl PartialEq<TriggerEvent> for TriggerEvent
sourcefn eq(&self, other: &TriggerEvent) -> bool
fn eq(&self, other: &TriggerEvent) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &TriggerEvent) -> bool
fn ne(&self, other: &TriggerEvent) -> bool
This method tests for !=.
impl Copy for TriggerEvent
impl Eq for TriggerEvent
impl StructuralEq for TriggerEvent
impl StructuralPartialEq for TriggerEvent
Auto Trait Implementations
impl RefUnwindSafe for TriggerEvent
impl Send for TriggerEvent
impl Sync for TriggerEvent
impl Unpin for TriggerEvent
impl UnwindSafe for TriggerEvent
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more