linux: Fix keycodes mapping on Wayland (#34396)
We are already converting Wayland keycodes to X11's; double conversion results in a wrong mapping. Release Notes: - N/A
This commit is contained in:
parent
f50041779d
commit
e4effa5e01
1 changed files with 4 additions and 6 deletions
|
@ -715,12 +715,10 @@ pub(crate) enum KeycodeSource {
|
|||
#[cfg(any(feature = "wayland", feature = "x11"))]
|
||||
impl KeycodeSource {
|
||||
fn guess_ascii(&self, keycode: Keycode, shift: bool) -> Option<char> {
|
||||
let raw = match self {
|
||||
// For historical reasons X11 adds 8 to keycodes
|
||||
Self::X11 => keycode.raw() - 8,
|
||||
// For no particular reason, wayland doesn't.
|
||||
Self::Wayland => keycode.raw(),
|
||||
};
|
||||
// For historical reasons, X11 adds 8 to keycodes.
|
||||
// Wayland doesn't, but by this point, our own Wayland client
|
||||
// has added 8 for X11 compatibility.
|
||||
let raw = keycode.raw() - 8;
|
||||
let c = match (raw, shift) {
|
||||
(16, _) => 'q',
|
||||
(17, _) => 'w',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue