Fix ctrl-q on AZERTY on Linux (#34597)
Closes #ISSUE Release Notes: - N/A
This commit is contained in:
parent
9f302df6d6
commit
1ce384bbda
1 changed files with 16 additions and 2 deletions
|
@ -822,14 +822,28 @@ impl crate::Keystroke {
|
||||||
Keysym::underscore => "_".to_owned(),
|
Keysym::underscore => "_".to_owned(),
|
||||||
Keysym::equal => "=".to_owned(),
|
Keysym::equal => "=".to_owned(),
|
||||||
Keysym::plus => "+".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();
|
let name = xkb::keysym_get_name(key_sym).to_lowercase();
|
||||||
if key_sym.is_keypad_key() {
|
if key_sym.is_keypad_key() {
|
||||||
name.replace("kp_", "")
|
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) {
|
} else if let Some(key_en) = guess_ascii(keycode, modifiers.shift) {
|
||||||
String::from(key_en)
|
String::from(key_en)
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue