modify keymap to match the keyboard
This commit is contained in:
@@ -101,11 +101,11 @@ pub enum KeyCode {
|
||||
LeftCtrl = 0xE0,
|
||||
LeftShift = 0xE1,
|
||||
LeftAlt = 0xE2,
|
||||
LeftGui = 0xE3,
|
||||
LeftMeta = 0xE3,
|
||||
RightCtrl = 0xE4,
|
||||
RightShift = 0xE5,
|
||||
RightAlt = 0xE6, // AltGr
|
||||
RightGui = 0xE7,
|
||||
RightMeta = 0xE7,
|
||||
}
|
||||
|
||||
impl KeyCode {
|
||||
@@ -115,8 +115,8 @@ impl KeyCode {
|
||||
|
||||
pub const fn is_modifier(self) -> bool {
|
||||
matches!(self,
|
||||
KeyCode::LeftCtrl | KeyCode::LeftShift | KeyCode::LeftAlt | KeyCode::LeftGui |
|
||||
KeyCode::RightCtrl | KeyCode::RightShift | KeyCode::RightAlt | KeyCode::RightGui
|
||||
KeyCode::LeftCtrl | KeyCode::LeftShift | KeyCode::LeftAlt | KeyCode::LeftMeta |
|
||||
KeyCode::RightCtrl | KeyCode::RightShift | KeyCode::RightAlt | KeyCode::RightMeta
|
||||
)
|
||||
}
|
||||
|
||||
@@ -125,11 +125,11 @@ impl KeyCode {
|
||||
KeyCode::LeftCtrl => 0x01,
|
||||
KeyCode::LeftShift => 0x02,
|
||||
KeyCode::LeftAlt => 0x04,
|
||||
KeyCode::LeftGui => 0x08,
|
||||
KeyCode::LeftMeta => 0x08,
|
||||
KeyCode::RightCtrl => 0x10,
|
||||
KeyCode::RightShift => 0x20,
|
||||
KeyCode::RightAlt => 0x40, // AltGr
|
||||
KeyCode::RightGui => 0x80,
|
||||
KeyCode::RightMeta => 0x80,
|
||||
_ => 0,
|
||||
}
|
||||
}
|
||||
@@ -146,7 +146,7 @@ pub const KEYMAP: [[KeyCode; 12]; 4] = [
|
||||
[
|
||||
KeyCode::Tab, KeyCode::A, KeyCode::S, KeyCode::D,
|
||||
KeyCode::F, KeyCode::G, KeyCode::H, KeyCode::J,
|
||||
KeyCode::K, KeyCode::L, KeyCode::Quote, KeyCode::Enter,
|
||||
KeyCode::K, KeyCode::L, KeyCode::Semicolon, KeyCode::Enter,
|
||||
],
|
||||
[
|
||||
KeyCode::LeftShift, KeyCode::Z, KeyCode::X, KeyCode::C,
|
||||
@@ -154,9 +154,9 @@ pub const KEYMAP: [[KeyCode; 12]; 4] = [
|
||||
KeyCode::Comma, KeyCode::Dot, KeyCode::Up, KeyCode::Slash,
|
||||
],
|
||||
[
|
||||
KeyCode::LeftCtrl, KeyCode::No, KeyCode::No, KeyCode::LeftAlt,
|
||||
KeyCode::No, KeyCode::Space, KeyCode::No, KeyCode::RightAlt,
|
||||
KeyCode::No, KeyCode::Left, KeyCode::Down, KeyCode::Right,
|
||||
KeyCode::LeftCtrl, KeyCode::No, KeyCode::LeftMeta, KeyCode::LeftAlt,
|
||||
KeyCode::No, KeyCode::Space, KeyCode::No, KeyCode::No,
|
||||
KeyCode::RightAlt, KeyCode::Left, KeyCode::Down, KeyCode::Right,
|
||||
],
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user