Skip to content

Commit

Permalink
fix control-character parsing in windows
Browse files Browse the repository at this point in the history
  • Loading branch information
WindSoilder committed Feb 16, 2022
1 parent 9a50fd2 commit d99f2f7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/event/sys/windows/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ fn parse_key_event_record(key_event: &KeyEventRecord) -> Option<KeyEvent> {
let c = character_raw as u8;
if c <= b'\x1F' {
character = (c | b'\x40') as char;
// if we press something like ctrl-g, we will get `character` with value `G`.
// in this case, convert the `character` to lowercase `g`.
if character.is_ascii_uppercase() {
character.make_ascii_lowercase();
}
} else {
return None;
}
Expand Down

0 comments on commit d99f2f7

Please sign in to comment.