windows: Don't report 'shift' for certain keys (#9479)

allows keybindings for character such as `:`, `?`, etc. (important for
vim mode!)

alternative solution is here: #9478

Release Notes:

- N/A
This commit is contained in:
Ezekiel Warren 2024-03-18 08:33:28 -07:00 committed by GitHub
parent be4e19b834
commit 9f96c43ff7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -455,8 +455,14 @@ impl WindowsWindowInner {
if first_char.is_control() {
None
} else {
let mut modifiers = self.current_modifiers();
// for characters that use 'shift' to type it is expected that the
// shift is not reported if the uppercase/lowercase are the same and instead only the key is reported
if first_char.to_lowercase().to_string() == first_char.to_uppercase().to_string() {
modifiers.shift = false;
}
Some(Keystroke {
modifiers: self.current_modifiers(),
modifiers,
key: first_char.to_lowercase().to_string(),
ime_key: Some(first_char.to_string()),
})