Fix ctrl-q on AZERTY on Linux (#34597)

Closes #ISSUE

Release Notes:

- N/A
This commit is contained in:
Conrad Irwin 2025-07-16 21:27:46 -06:00 committed by GitHub
parent 9f302df6d6
commit 1ce384bbda
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -822,14 +822,28 @@ impl crate::Keystroke {
Keysym::underscore => "_".to_owned(),
Keysym::equal => "=".to_owned(),
Keysym::plus => "+".to_owned(),
Keysym::space => "space".to_owned(),
Keysym::BackSpace => "backspace".to_owned(),
Keysym::Tab => "tab".to_owned(),
Keysym::Delete => "delete".to_owned(),
Keysym::Escape => "escape".to_owned(),
_ => {
let name = xkb::keysym_get_name(key_sym).to_lowercase();
if key_sym.is_keypad_key() {
name.replace("kp_", "")
} else if key_utf8.len() == 1 && key_utf8.chars().next().unwrap().is_ascii_graphic()
} else if let Some(key) = key_utf8.chars().next()
&& key_utf8.len() == 1
&& key.is_ascii()
{
key_utf8.clone()
if key.is_ascii_graphic() {
key_utf8.clone()
// map ctrl-a to a
} else if key_utf32 <= 0x1f {
((key_utf32 as u8 + 0x60) as char).to_string()
} else {
name
}
} else if let Some(key_en) = guess_ascii(keycode, modifiers.shift) {
String::from(key_en)
} else {