Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
TimonPost committed Jan 27, 2023
1 parent 2870e25 commit 1f21f9b
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/event/sys/windows/parse.rs
Expand Up @@ -13,7 +13,7 @@ use winapi::um::{
};

use crate::{
event::{Event, KeyCode, KeyEvent, KeyModifiers, MouseButton, MouseEventKind, KeyEventKind},
event::{Event, KeyCode, KeyEvent, KeyEventKind, KeyModifiers, MouseButton, MouseEventKind},
Result,
};

Expand Down Expand Up @@ -221,7 +221,11 @@ fn parse_key_event_record(key_event: &KeyEventRecord) -> Option<WindowsKeyEvent>
// values.
let ch = std::char::from_u32(unicode_scalar_value as u32).unwrap();
let key_code = KeyCode::Char(ch);
let kind = if key_event.key_down { KeyEventKind::Press } else { KeyEventKind::Release };
let kind = if key_event.key_down {
KeyEventKind::Press
} else {
KeyEventKind::Release
};
let key_event = KeyEvent::new_with_kind(key_code, modifiers, kind);
return Some(WindowsKeyEvent::KeyEvent(key_event));
}
Expand Down Expand Up @@ -280,7 +284,11 @@ fn parse_key_event_record(key_event: &KeyEventRecord) -> Option<WindowsKeyEvent>
};

if let Some(key_code) = parse_result {
let kind = if key_event.key_down { KeyEventKind::Press } else { KeyEventKind::Release };
let kind = if key_event.key_down {
KeyEventKind::Press
} else {
KeyEventKind::Release
};
let key_event = KeyEvent::new_with_kind(key_code, modifiers, kind);
return Some(WindowsKeyEvent::KeyEvent(key_event));
}
Expand Down

0 comments on commit 1f21f9b

Please sign in to comment.