Enum kll_core::Capability

source ·
#[repr(u8)]
pub enum Capability {
Show 22 variants NoOp { state: CapabilityState, loop_condition_index: u16, }, Rotate { state: CapabilityState, loop_condition_index: u16, index: u8, increment: i8, }, LayerClear { state: CapabilityState, loop_condition_index: u16, }, LayerState { state: CapabilityState, loop_condition_index: u16, layer: u8, layer_state: State, }, LayerRotate { state: CapabilityState, loop_condition_index: u16, direction: Direction, }, HidProtocol { state: CapabilityState, loop_condition_index: u16, mode: Protocol, }, HidKeyboard { state: CapabilityState, loop_condition_index: u16, id: Keyboard, }, HidKeyboardState { state: CapabilityState, loop_condition_index: u16, id: Keyboard, key_state: State, }, HidConsumerControl { state: CapabilityState, loop_condition_index: u16, id: ConsumerControl, }, HidSystemControl { state: CapabilityState, loop_condition_index: u16, id: SystemControl, }, McuFlashMode { state: CapabilityState, loop_condition_index: u16, }, PixelAnimationControl { state: CapabilityState, loop_condition_index: u16, mode: AnimationControl, }, PixelAnimationIndex { state: CapabilityState, loop_condition_index: u16, index: u16, }, PixelFadeControl { state: CapabilityState, loop_condition_index: u16, profile: u8, command: FadeCommand, arg: u8, }, PixelFadeLayer { state: CapabilityState, loop_condition_index: u16, layer: u8, }, PixelFadeSet { state: CapabilityState, loop_condition_index: u16, profile: u8, config: u8, period: u8, }, PixelGammaControl { state: CapabilityState, loop_condition_index: u16, mode: GammaControl, }, PixelLedControl { state: CapabilityState, loop_condition_index: u16, mode: LedControl, amount: u8, }, PixelTest { state: CapabilityState, loop_condition_index: u16, test: PixelTest, index: u16, }, HidioOpenUrl { state: CapabilityState, loop_condition_index: u16, index: u16, }, HidioUnicodeString { state: CapabilityState, loop_condition_index: u16, index: u16, }, HidioUnicodeState { state: CapabilityState, loop_condition_index: u16, unicode: char, },
}
Expand description

Global capability list for KLL NOTE: Changing parameters and removing entries will require a firmware reflash. At worst, KLL file and compiler definitions may also need to be updated. Please avoid these kinds of changes if possible. Adding new entries is safe.

Variants

NoOp

Fields

state: CapabilityState

Capability state

loop_condition_index: u16

Scanning loop condition (number of scanning loops attached to state condition) Lookup index

No-op / None action 4 bytes

Rotate

Fields

state: CapabilityState

Capability state

loop_condition_index: u16

Scanning loop condition (number of scanning loops attached to state condition) Lookup index

index: u8
increment: i8

Rotation event trigger 6 bytes

LayerClear

Fields

state: CapabilityState

Capability state

loop_condition_index: u16

Scanning loop condition (number of scanning loops attached to state condition) Lookup index

Clears all layer states NOTE: Does not send trigger events 4 bytes

LayerState

Fields

state: CapabilityState

Capability state

loop_condition_index: u16

Scanning loop condition (number of scanning loops attached to state condition) Lookup index

layer: u8
layer_state: State

Updates layer to the specified state 6 bytes

LayerRotate

Fields

state: CapabilityState

Capability state

loop_condition_index: u16

Scanning loop condition (number of scanning loops attached to state condition) Lookup index

direction: Direction

Rotates through possible layers given the direction Uses internal state to keep track of the current layer 5 bytes

HidProtocol

Fields

state: CapabilityState

Capability state

loop_condition_index: u16

Scanning loop condition (number of scanning loops attached to state condition) Lookup index

mode: Protocol

HID Protocol Mode 5 bytes

HidKeyboard

Fields

state: CapabilityState

Capability state

loop_condition_index: u16

Scanning loop condition (number of scanning loops attached to state condition) Lookup index

USB HID keyboard event Handles press/released based on incoming state 5 bytes

HidKeyboardState

Fields

state: CapabilityState

Capability state

loop_condition_index: u16

Scanning loop condition (number of scanning loops attached to state condition) Lookup index

key_state: State

USB HID keyboard event Force state event 6 bytes

HidConsumerControl

Fields

state: CapabilityState

Capability state

loop_condition_index: u16

Scanning loop condition (number of scanning loops attached to state condition) Lookup index

USB HID Consumer Control Event Handles press/released based on incoming state 6 bytes

HidSystemControl

Fields

state: CapabilityState

Capability state

loop_condition_index: u16

Scanning loop condition (number of scanning loops attached to state condition) Lookup index

USB HID System Control Event Handles press/released based on incoming state 5 bytes

McuFlashMode

Fields

state: CapabilityState

Capability state

loop_condition_index: u16

Scanning loop condition (number of scanning loops attached to state condition) Lookup index

Enter Flash Mode Usually jumps to the bootloader 4 bytes

PixelAnimationControl

Fields

state: CapabilityState

Capability state

loop_condition_index: u16

Scanning loop condition (number of scanning loops attached to state condition) Lookup index

Overall animation control 5 bytes

PixelAnimationIndex

Fields

state: CapabilityState

Capability state

loop_condition_index: u16

Scanning loop condition (number of scanning loops attached to state condition) Lookup index

index: u16

Activates the given indexed Animation 6 bytes

PixelFadeControl

Fields

state: CapabilityState

Capability state

loop_condition_index: u16

Scanning loop condition (number of scanning loops attached to state condition) Lookup index

profile: u8
command: FadeCommand
arg: u8

Fade control 7 bytes

PixelFadeLayer

Fields

state: CapabilityState

Capability state

loop_condition_index: u16

Scanning loop condition (number of scanning loops attached to state condition) Lookup index

layer: u8

Layer fade 5 bytes

PixelFadeSet

Fields

state: CapabilityState

Capability state

loop_condition_index: u16

Scanning loop condition (number of scanning loops attached to state condition) Lookup index

profile: u8
config: u8
period: u8

Fade set profile 7 bytes

PixelGammaControl

Fields

state: CapabilityState

Capability state

loop_condition_index: u16

Scanning loop condition (number of scanning loops attached to state condition) Lookup index

Enable/Disable/Toggle gamma correction 5 bytes

PixelLedControl

Fields

state: CapabilityState

Capability state

loop_condition_index: u16

Scanning loop condition (number of scanning loops attached to state condition) Lookup index

mode: LedControl
amount: u8

LED Control 6 bytes

PixelTest

Fields

state: CapabilityState

Capability state

loop_condition_index: u16

Scanning loop condition (number of scanning loops attached to state condition) Lookup index

test: PixelTest
index: u16

Pixel test 7 bytes

HidioOpenUrl

Fields

state: CapabilityState

Capability state

loop_condition_index: u16

Scanning loop condition (number of scanning loops attached to state condition) Lookup index

index: u16

Sends URL (using index stored unicode string) to host computer web browser 6 bytes

HidioUnicodeString

Fields

state: CapabilityState

Capability state

loop_condition_index: u16

Scanning loop condition (number of scanning loops attached to state condition) Lookup index

index: u16

Sends Unicode string (using index stored unicode string) to host computer 6 bytes

HidioUnicodeState

Fields

state: CapabilityState

Capability state

loop_condition_index: u16

Scanning loop condition (number of scanning loops attached to state condition) Lookup index

unicode: char

Sends Unicode character with state (Press or Release) 8 bytes

Implementations

Generate a CapabilityRun using a Capability + TriggerEvent The TriggerEvent is only important when CapabilityState::Passthrough is set.

Lookup loop_condition_index

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 Capability

Safety

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

Convert Capability to CapabilityRun Used for mainly for kll validation

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 !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. 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
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.