termwiz: windows: normalize SHIFT+ASCII

This makes the input behavior consistent with posix: if SHIFT is held
and a letter key is pressed, make sure that we treat that as the ascii
uppercase version of that key and that the SHIFT modifier is cleared.
This commit is contained in:
Wez Furlong committed 2020-01-17 16:56:29 -08:00
1 parent fd87e7c9a0
commit 51545ab099
1 file changed
+8 -1
+8 -1
View File
@@ -370,7 +370,14 @@ mod windows {
_ => return,
},
};
let modifiers = modifiers_from_ctrl_key_state(event.dwControlKeyState);
let mut modifiers = modifiers_from_ctrl_key_state(event.dwControlKeyState);
let key_code = key_code.normalize_shift_to_upper_case(modifiers);
if let KeyCode::Char(c) = key_code {
if c.is_ascii_uppercase() {
modifiers.remove(Modifiers::SHIFT);
}
}
let input_event = InputEvent::Key(KeyEvent {
key: key_code,