Skip to content
This repository has been archived by the owner on Oct 22, 2019. It is now read-only.

Commit

Permalink
Made read sync windows block
Browse files Browse the repository at this point in the history
  • Loading branch information
TimonPost committed Oct 8, 2019
1 parent 73477c9 commit bb53032
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- Remove all references to the crossterm book
- Mouse coordinates synchronized with the cursor (breaking)
- Upper/left reported as `(0, 0)`
- Fixed bug that read sync didnt block

## Windows only

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ edition = "2018"

[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3.8", features = ["winnt", "winuser"] }
crossterm_winapi = { version = "0.2.1" }
crossterm_winapi = { git = "https://github.com/crossterm-rs/crossterm-winapi.git", branch = "master", version = "0.2.1" }

[target.'cfg(unix)'.dependencies]
libc = "0.2.51"
Expand Down
5 changes: 1 addition & 4 deletions src/input/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,10 +339,7 @@ extern "C" {
fn read_single_event() -> Result<Option<InputEvent>> {
let console = Console::from(Handle::current_in_handle()?);

let input = match console.read_single_input_event()? {
Some(event) => event,
None => return Ok(None),
};
let input = console.read_single_input_event()?;

match input.event_type {
InputEventType::KeyEvent => {
Expand Down

0 comments on commit bb53032

Please sign in to comment.