- Rust 98.9%
- Just 1.1%
| assets | add more display edges, update demo image | |
| src | fmt + clippy | |
| .gitignore | concept, most customization options implemented | |
| Cargo.toml | concept, most customization options implemented | |
| firefly.toml | add alphabet layout, add cursor to text editor | |
| justfile | concept, most customization options implemented | |
| README.md | fix readme example | |
luxboard
Virtual keyboard for Firefly Zero!
User guide
While in Luxboard, the touchpad is mapped to nine areas, with each area containing four characters. The characters are mapped to the N, E, S, and W buttons respectively, going clockwise from the top character. To type a character, press down on the touchpad in the area where the character where you would like is placed, then press the corresponding button.
The bottom right area changes switches letter casing on N, and switches to an extra characters layout on S.
When the touchpad is not being touched, E is mapped to space, S is mapped to exit, and W is mapped to backspace.
Developer guide
First, initialize Luxboard:
letluxboard=Luxboard::default()// or if you'd like to define some custom options...
letluxboard=Luxboard::new(LuxboardOptions{highlight_color: Some(firefly_rust::Color::Red),..Default::default()})Then, place the Luxboard functions update() and render() into the Firefly SDK's update() and render() functions. Here is an example implementation:
#[unsafe(no_mangle)]extern"C"fn update(){// ...
ifprecondition{matchluxboard.update(){// returns the current state of the luxboard
LuxboardState::Closed=>{ifpressed_buttons.n{luxboard.open();}},LuxboardState::JustClosed(output)=>{// do something with output text here...
}}}// ...
}#[unsafe(no_mangle)]extern"C"fn render(){// ...
ifluxboard.is_open(){luxboard.render(&font);}// ...
}