windows: fix 'space' keystroke keydown event (#9476)

the space key was being reported as key " " which didn't allow it to be
used in keybindings

Release Notes:

- N/A
This commit is contained in:
Ezekiel Warren 2024-03-19 10:35:28 -07:00 committed by GitHub
parent fd0071f2af
commit ac6c4f3ca8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -484,9 +484,13 @@ impl WindowsWindowInner {
if first_char.to_lowercase().to_string() == first_char.to_uppercase().to_string() {
modifiers.shift = false;
}
let key = match first_char {
' ' => "space".to_string(),
first_char => first_char.to_lowercase().to_string(),
};
Some(Keystroke {
modifiers,
key: first_char.to_lowercase().to_string(),
key,
ime_key: Some(first_char.to_string()),
})
}