reorganized the keymap file location

This commit is contained in:
vextrixes committed 2026-06-10 17:01:31 +02:00
1 parent 25d4a10f4f
commit f1cd5917bc
3 files changed
+6 -2

No files matched your search

@@ -1,5 +1,6 @@
use crate::color::Color;
/// an Enum to get the id of a key
pub enum KeymapKeys {
Escape,
F1,
@@ -112,6 +113,7 @@ pub enum KeymapKeys {
}
impl KeymapKeys {
/// returns the id of a key
fn to_usize(&self) -> usize {
match self {
KeymapKeys::Escape => 1,
@@ -237,10 +239,12 @@ impl Default for Keymap {
}
impl Keymap {
///sets a single key to a color
pub fn set_key(&mut self, key: KeymapKeys, color: Color) {
self.map[key.to_usize()] = color.to_array();
}
//sets a all key to a color
pub fn set_all_keys(&mut self, color: Color) {
self.map = [color.to_array(); 144];
}
+2 -1
View File
@@ -1,12 +1,13 @@
mod color;
mod hid_wrapper;
mod rgb_controller;
mod keymap;
pub use color::Color;
pub use hid_wrapper::HidWrapperError;
pub use rgb_controller::controller::RGBController;
pub use rgb_controller::effects::Effects;
pub use rgb_controller::keymap::{Keymap, KeymapKeys};
pub use keymap::{Keymap, KeymapKeys};
#[cfg(feature = "access_hid_wrapper")]
pub use hid_wrapper::HidWrapper;
-1
View File
@@ -1,4 +1,3 @@
pub mod controller;
pub mod effect_info;
pub mod effects;
pub mod keymap;