lifeblood_os/liblbos/src/keymap.rs

95 lines
1.6 KiB
Rust
Raw Normal View History

2025-09-13 17:36:00 -07:00
#[repr(C)]
#[derive(Copy, Clone)]
pub struct Keymap {
pub alpha: u16,
pub beta: u32,
pub gamma: u16,
pub delta: u16,
}
#[repr(u16)]
#[derive(Copy, Clone)]
pub enum KeymapSection {
Alpha = 1,
Beta = 2,
Gamma = 3,
Delta = 4,
}
#[repr(u16)]
#[derive(Copy, Clone)]
pub enum KeyAlpha {
Esc = 1 << 0,
Key1 = 1 << 1,
Key2 = 1 << 2,
Key3 = 1 << 3,
Key4 = 1 << 4,
Key5 = 1 << 5,
Key6 = 1 << 6,
Key7 = 1 << 7,
Key8 = 1 << 8,
Key9 = 1 << 9,
Key0 = 1 << 10,
Minus = 1 << 11,
Equal = 1 << 12,
Backspace = 1 << 13,
Tab = 1 << 14,
Enter = 1 << 15,
}
#[repr(u32)]
#[derive(Copy, Clone)]
pub enum KeyBeta {
A = 1 << 0,
B = 1 << 1,
C = 1 << 2,
D = 1 << 3,
E = 1 << 4,
F = 1 << 5,
G = 1 << 6,
H = 1 << 7,
I = 1 << 8,
J = 1 << 9,
K = 1 << 10,
L = 1 << 11,
M = 1 << 12,
N = 1 << 13,
O = 1 << 14,
P = 1 << 15,
Q = 1 << 16,
R = 1 << 17,
S = 1 << 18,
T = 1 << 19,
U = 1 << 20,
V = 1 << 21,
W = 1 << 22,
X = 1 << 23,
Y = 1 << 24,
Z = 1 << 25,
}
#[repr(u16)]
#[derive(Copy, Clone)]
pub enum KeyGamma {
LeftBracket = 1 << 0,
RightBracket = 1 << 1,
Semicolon = 1 << 2,
Apostrophe = 1 << 3,
Grave = 1 << 4,
Backslash = 1 << 5,
Comma = 1 << 6,
Dot = 1 << 7,
Slash = 1 << 8,
Space = 1 << 9,
Control = 1 << 10,
Shift = 1 << 11,
Alt = 1 << 12,
}
#[repr(u16)]
pub enum KeyDelta {
UpArrow = 1 << 0,
DownArrow = 1 << 1,
LeftArrow = 1 << 12,
RightArrow = 1 << 13,
}