mapped key ids for keymap
This commit is contained in:
4 files changed
+229
No files matched your search
@@ -1,5 +1,7 @@
|
|||||||
pkg/
|
pkg/
|
||||||
*.tar
|
*.tar
|
||||||
|
*.ignored
|
||||||
|
ignored/
|
||||||
|
|
||||||
### VisualStudioCode template
|
### VisualStudioCode template
|
||||||
.vscode/*
|
.vscode/*
|
||||||
|
|||||||
@@ -4,3 +4,4 @@ mod rgb_controller;
|
|||||||
pub use hid_wrapper::HidWrapperError;
|
pub use hid_wrapper::HidWrapperError;
|
||||||
pub use rgb_controller::controller::RGBController;
|
pub use rgb_controller::controller::RGBController;
|
||||||
pub use rgb_controller::effects::Effects;
|
pub use rgb_controller::effects::Effects;
|
||||||
|
pub use rgb_controller::keymap::KeymapKeys;
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
pub mod controller;
|
pub mod controller;
|
||||||
pub mod effect_info;
|
pub mod effect_info;
|
||||||
pub mod effects;
|
pub mod effects;
|
||||||
|
pub mod keymap;
|
||||||
@@ -0,0 +1,225 @@
|
|||||||
|
pub enum KeymapKeys {
|
||||||
|
Escape,
|
||||||
|
F1,
|
||||||
|
F2,
|
||||||
|
F3,
|
||||||
|
F4,
|
||||||
|
F5,
|
||||||
|
F6,
|
||||||
|
F7,
|
||||||
|
F8,
|
||||||
|
F9,
|
||||||
|
F10,
|
||||||
|
F11,
|
||||||
|
F12,
|
||||||
|
Tilde,
|
||||||
|
One,
|
||||||
|
Two,
|
||||||
|
Three,
|
||||||
|
Four,
|
||||||
|
Five,
|
||||||
|
Six,
|
||||||
|
Seven,
|
||||||
|
Eight,
|
||||||
|
Nine,
|
||||||
|
Zero,
|
||||||
|
Hyphen,
|
||||||
|
Equal,
|
||||||
|
Backspace,
|
||||||
|
Tab,
|
||||||
|
Q,
|
||||||
|
W,
|
||||||
|
E,
|
||||||
|
R,
|
||||||
|
T,
|
||||||
|
Y,
|
||||||
|
U,
|
||||||
|
I,
|
||||||
|
O,
|
||||||
|
P,
|
||||||
|
OpenBracket,
|
||||||
|
ClosedBracket,
|
||||||
|
Backslash,
|
||||||
|
Caps,
|
||||||
|
A,
|
||||||
|
S,
|
||||||
|
D,
|
||||||
|
F,
|
||||||
|
G,
|
||||||
|
H,
|
||||||
|
J,
|
||||||
|
K,
|
||||||
|
L,
|
||||||
|
Semicolon,
|
||||||
|
Quotes,
|
||||||
|
Enter,
|
||||||
|
LeftShift,
|
||||||
|
Z,
|
||||||
|
X,
|
||||||
|
C,
|
||||||
|
V,
|
||||||
|
B,
|
||||||
|
N,
|
||||||
|
M,
|
||||||
|
Comma,
|
||||||
|
Period,
|
||||||
|
Slash,
|
||||||
|
RightShift,
|
||||||
|
LeftControl,
|
||||||
|
Super,
|
||||||
|
LeftAlt,
|
||||||
|
Space,
|
||||||
|
RightAlt,
|
||||||
|
Function,
|
||||||
|
Menu,
|
||||||
|
RightControl,
|
||||||
|
PrintScreen,
|
||||||
|
ScrollLock,
|
||||||
|
Pause,
|
||||||
|
Insert,
|
||||||
|
Home,
|
||||||
|
PageUp,
|
||||||
|
Delete,
|
||||||
|
End,
|
||||||
|
PageDown,
|
||||||
|
Up,
|
||||||
|
Left,
|
||||||
|
Down,
|
||||||
|
Right,
|
||||||
|
VolumeUp,
|
||||||
|
VolumeDown,
|
||||||
|
Mute,
|
||||||
|
Calculator,
|
||||||
|
NumLock,
|
||||||
|
NumSlash,
|
||||||
|
NumStar,
|
||||||
|
NumMinus,
|
||||||
|
Num7,
|
||||||
|
Num8,
|
||||||
|
Num9,
|
||||||
|
Num4,
|
||||||
|
Num5,
|
||||||
|
Num6,
|
||||||
|
Num1,
|
||||||
|
Num2,
|
||||||
|
Num3,
|
||||||
|
Num0,
|
||||||
|
NumDot,
|
||||||
|
NumEnter,
|
||||||
|
NumPlus,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Into<usize> for KeymapKeys {
|
||||||
|
fn into(self) -> usize {
|
||||||
|
match self {
|
||||||
|
KeymapKeys::Escape => 1,
|
||||||
|
KeymapKeys::F1 => 2,
|
||||||
|
KeymapKeys::F2 => 3,
|
||||||
|
KeymapKeys::F3 => 4,
|
||||||
|
KeymapKeys::F4 => 5,
|
||||||
|
KeymapKeys::F5 => 6,
|
||||||
|
KeymapKeys::F6 => 7,
|
||||||
|
KeymapKeys::F7 => 8,
|
||||||
|
KeymapKeys::F8 => 9,
|
||||||
|
KeymapKeys::F9 => 10,
|
||||||
|
KeymapKeys::F10 => 11,
|
||||||
|
KeymapKeys::F11 => 12,
|
||||||
|
KeymapKeys::F12 => 13,
|
||||||
|
KeymapKeys::Tilde => 19,
|
||||||
|
KeymapKeys::One => 20,
|
||||||
|
KeymapKeys::Two => 21,
|
||||||
|
KeymapKeys::Three => 22,
|
||||||
|
KeymapKeys::Four => 23,
|
||||||
|
KeymapKeys::Five => 24,
|
||||||
|
KeymapKeys::Six => 25,
|
||||||
|
KeymapKeys::Seven => 26,
|
||||||
|
KeymapKeys::Eight => 27,
|
||||||
|
KeymapKeys::Nine => 28,
|
||||||
|
KeymapKeys::Zero => 29,
|
||||||
|
KeymapKeys::Hyphen => 30,
|
||||||
|
KeymapKeys::Equal => 31,
|
||||||
|
KeymapKeys::Backspace => 103,
|
||||||
|
KeymapKeys::Tab => 37,
|
||||||
|
KeymapKeys::Q => 38,
|
||||||
|
KeymapKeys::W => 39,
|
||||||
|
KeymapKeys::E => 40,
|
||||||
|
KeymapKeys::R => 41,
|
||||||
|
KeymapKeys::T => 42,
|
||||||
|
KeymapKeys::Y => 43,
|
||||||
|
KeymapKeys::U => 44,
|
||||||
|
KeymapKeys::I => 45,
|
||||||
|
KeymapKeys::O => 46,
|
||||||
|
KeymapKeys::P => 47,
|
||||||
|
KeymapKeys::OpenBracket => 48,
|
||||||
|
KeymapKeys::ClosedBracket => 49,
|
||||||
|
KeymapKeys::Backslash => 67,
|
||||||
|
KeymapKeys::Caps => 55,
|
||||||
|
KeymapKeys::A => 56,
|
||||||
|
KeymapKeys::S => 57,
|
||||||
|
KeymapKeys::D => 58,
|
||||||
|
KeymapKeys::F => 59,
|
||||||
|
KeymapKeys::G => 60,
|
||||||
|
KeymapKeys::H => 61,
|
||||||
|
KeymapKeys::J => 62,
|
||||||
|
KeymapKeys::K => 63,
|
||||||
|
KeymapKeys::L => 64,
|
||||||
|
KeymapKeys::Semicolon => 65,
|
||||||
|
KeymapKeys::Quotes => 66,
|
||||||
|
KeymapKeys::Enter => 85,
|
||||||
|
KeymapKeys::LeftShift => 73,
|
||||||
|
KeymapKeys::Z => 74,
|
||||||
|
KeymapKeys::X => 75,
|
||||||
|
KeymapKeys::C => 76,
|
||||||
|
KeymapKeys::V => 77,
|
||||||
|
KeymapKeys::B => 78,
|
||||||
|
KeymapKeys::N => 79,
|
||||||
|
KeymapKeys::M => 80,
|
||||||
|
KeymapKeys::Comma => 81,
|
||||||
|
KeymapKeys::Period => 82,
|
||||||
|
KeymapKeys::Slash => 83,
|
||||||
|
KeymapKeys::RightShift => 84,
|
||||||
|
KeymapKeys::LeftControl => 91,
|
||||||
|
KeymapKeys::Super => 92,
|
||||||
|
KeymapKeys::LeftAlt => 93,
|
||||||
|
KeymapKeys::Space => 94,
|
||||||
|
KeymapKeys::RightAlt => 95,
|
||||||
|
KeymapKeys::Function => 96,
|
||||||
|
KeymapKeys::Menu => 97,
|
||||||
|
KeymapKeys::RightControl => 98,
|
||||||
|
KeymapKeys::PrintScreen => 112,
|
||||||
|
KeymapKeys::ScrollLock => 113,
|
||||||
|
KeymapKeys::Pause => 115,
|
||||||
|
KeymapKeys::Insert => 116,
|
||||||
|
KeymapKeys::Home => 117,
|
||||||
|
KeymapKeys::PageUp => 118,
|
||||||
|
KeymapKeys::Delete => 119,
|
||||||
|
KeymapKeys::End => 120,
|
||||||
|
KeymapKeys::PageDown => 121,
|
||||||
|
KeymapKeys::Up => 101,
|
||||||
|
KeymapKeys::Left => 99,
|
||||||
|
KeymapKeys::Down => 100,
|
||||||
|
KeymapKeys::Right => 102,
|
||||||
|
KeymapKeys::VolumeUp => 14,
|
||||||
|
KeymapKeys::VolumeDown => 15,
|
||||||
|
KeymapKeys::Mute => 16,
|
||||||
|
KeymapKeys::Calculator => 109,
|
||||||
|
KeymapKeys::NumLock => 32,
|
||||||
|
KeymapKeys::NumSlash => 33,
|
||||||
|
KeymapKeys::NumStar => 34,
|
||||||
|
KeymapKeys::NumMinus => 122,
|
||||||
|
KeymapKeys::Num7 => 50,
|
||||||
|
KeymapKeys::Num8 => 51,
|
||||||
|
KeymapKeys::Num9 => 52,
|
||||||
|
KeymapKeys::Num4 => 68,
|
||||||
|
KeymapKeys::Num5 => 69,
|
||||||
|
KeymapKeys::Num6 => 70,
|
||||||
|
KeymapKeys::Num1 => 86,
|
||||||
|
KeymapKeys::Num2 => 87,
|
||||||
|
KeymapKeys::Num3 => 88,
|
||||||
|
KeymapKeys::Num0 => 104,
|
||||||
|
KeymapKeys::NumDot => 105,
|
||||||
|
KeymapKeys::NumEnter => 106,
|
||||||
|
KeymapKeys::NumPlus => 123,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user