[][src]Trait keebrs::backlight::BacklightEffect

pub trait BacklightEffect {
    fn on_key_event(&mut self, key: PhysKey);
fn on_tick(&mut self);
fn get_hsv(&self, position: (u8, u8)) -> Option<Hsv>; fn on_backlight_change(&mut self) { ... } }

Trait representing an effect to display on the backlight.

Required methods

fn on_key_event(&mut self, key: PhysKey)

Update the internal state of the effect based on a key press or release

fn on_tick(&mut self)

Update the internal state of the effect when a backlight 'tick' occurs

The length of a tick depends on the frequency of the timer controlling the backlight system

fn get_hsv(&self, position: (u8, u8)) -> Option<Hsv>

Returns the colour of the LED at the specified position based on the current state of the effect

Loading content...

Provided methods

fn on_backlight_change(&mut self)

Triggered when a "Backlight effect change" message is received. In general, this should not do anything. It is only used for effects which are unions of other effects

Loading content...

Implementors

Loading content...