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:
1 parent
fd87e7c9a0
commit
51545ab099
1 file changed
+8
-1
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user