Skip to content

Commit

Permalink
console_engine and crossterm update (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
lesleyrs authored Apr 9, 2023
1 parent ffedfaa commit 384aba1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ lto = true
[workspace.dependencies]
bincode = "1.3.3"
chrono = "0.4.24"
console_engine = "2.5.1"
console_engine = "2.6.0"
crossbeam-channel = "0.5.7"
crossterm = { version = "0.24.0", features = ["serde"] }
crossterm = { version = "0.26.1", features = ["serde"] }
laminar = "0.5.0"
legion = "0.4.0"
log = "0.4.17"
Expand Down
8 changes: 6 additions & 2 deletions rustyhack_client/src/client_game.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ mod client_updates_handler;
mod input;
mod screens;

use console_engine::{ConsoleEngine, KeyCode, KeyModifiers};
use console_engine::{ConsoleEngine, KeyCode, KeyEventKind, KeyModifiers};
use crossbeam_channel::{Receiver, Sender};
use crossterm::style::Color;
use laminar::{Packet, SocketEvent};
Expand Down Expand Up @@ -118,5 +118,9 @@ pub(super) fn run(
}

fn should_quit(console: &ConsoleEngine) -> bool {
console.is_key_pressed_with_modifier(KeyCode::Char('q'), KeyModifiers::CONTROL)
console.is_key_pressed_with_modifier(
KeyCode::Char('q'),
KeyModifiers::CONTROL,
KeyEventKind::Press,
)
}

0 comments on commit 384aba1

Please sign in to comment.