diff --git a/src/native/linux_wayland/keycodes.rs b/src/native/linux_wayland/keycodes.rs index 432a6f2f..4737317b 100644 --- a/src/native/linux_wayland/keycodes.rs +++ b/src/native/linux_wayland/keycodes.rs @@ -1,6 +1,7 @@ use crate::event::KeyCode; pub fn translate(keysym: u32) -> KeyCode { + // See xkbcommon/xkbcommon-keysyms.h match keysym { 65307 => return KeyCode::Escape, 65289 => return KeyCode::Tab, @@ -72,32 +73,32 @@ pub fn translate(keysym: u32) -> KeyCode { 65439 => return KeyCode::KpDecimal, 65469 => return KeyCode::KpEqual, 65421 => return KeyCode::KpEnter, - 97 => return KeyCode::A, - 98 => return KeyCode::B, - 99 => return KeyCode::C, - 100 => return KeyCode::D, - 101 => return KeyCode::E, - 102 => return KeyCode::F, - 103 => return KeyCode::G, - 104 => return KeyCode::H, - 105 => return KeyCode::I, - 106 => return KeyCode::J, - 107 => return KeyCode::K, - 108 => return KeyCode::L, - 109 => return KeyCode::M, - 110 => return KeyCode::N, - 111 => return KeyCode::O, - 112 => return KeyCode::P, - 113 => return KeyCode::Q, - 114 => return KeyCode::R, - 115 => return KeyCode::S, - 116 => return KeyCode::T, - 117 => return KeyCode::U, - 118 => return KeyCode::V, - 119 => return KeyCode::W, - 120 => return KeyCode::X, - 121 => return KeyCode::Y, - 122 => return KeyCode::Z, + 65 | 97 => return KeyCode::A, + 66 | 98 => return KeyCode::B, + 67 | 99 => return KeyCode::C, + 68 | 100 => return KeyCode::D, + 69 | 101 => return KeyCode::E, + 70 | 102 => return KeyCode::F, + 71 | 103 => return KeyCode::G, + 72 | 104 => return KeyCode::H, + 73 | 105 => return KeyCode::I, + 74 | 106 => return KeyCode::J, + 75 | 107 => return KeyCode::K, + 76 | 108 => return KeyCode::L, + 77 | 109 => return KeyCode::M, + 78 | 110 => return KeyCode::N, + 79 | 111 => return KeyCode::O, + 80 | 112 => return KeyCode::P, + 81 | 113 => return KeyCode::Q, + 82 | 114 => return KeyCode::R, + 83 | 115 => return KeyCode::S, + 84 | 116 => return KeyCode::T, + 85 | 117 => return KeyCode::U, + 86 | 118 => return KeyCode::V, + 87 | 119 => return KeyCode::W, + 88 | 120 => return KeyCode::X, + 89 | 121 => return KeyCode::Y, + 90 | 122 => return KeyCode::Z, 49 => return KeyCode::Key1, 50 => return KeyCode::Key2, 51 => return KeyCode::Key3,