Skip to content

Commit

Permalink
0.15 (#375)
Browse files Browse the repository at this point in the history
  • Loading branch information
TimonPost authored Jan 29, 2020
1 parent f2fca91 commit 75c59f3
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
16 changes: 8 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# master
- Added a generic implementation `Command` for `&T: Command`. This allows commands to be queued by reference, as well as by value.
- Removed unnecessary trait bounds from StyledContent.
- Added `StyledContent::style_mut`.
- `execute!` and `queue!` now correctly handle errors during writing.
- Fixed minor syntax bug in `execute!` and `queue!`.
- Cleaned up implementation of `execute!` and `queue!`.
- **breaking change** Changed `ContentStyle::apply` to take self by value instead of reference, to prevent an unnecessary extra clone.
# Version 0.15.0
- Fix CTRL + J key combination. This used to return an ENTER event.
- Add a generic implementation `Command` for `&T: Command`. This allows commands to be queued by reference, as well as by value.
- Remove unnecessary `Clone` trait bounds from `StyledContent`.
- Add `StyledContent::style_mut`.
- Handle error correctly for `execute!` and `queue!`.
- Fix minor syntax bug in `execute!` and `queue!`.
- Change `ContentStyle::apply` to take self by value instead of reference, to prevent an unnecessary extra clone.
- Added basic trait implementations (`Debug`, `Clone`, `Copy`, etc) to all of the command structs
- `ResetColor` uses `&'static str` instead of `String`

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ version = "0.3.8"
features = ["winuser"]

[target.'cfg(windows)'.dependencies]
crossterm_winapi = "0.6.0"
crossterm_winapi = "0.6.1"

#
# UNIX dependencies
Expand Down
10 changes: 5 additions & 5 deletions src/event/source/windows.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::time::Duration;

use crossterm_winapi::{Console, Handle, InputEvent, KeyEventRecord, MouseEvent};
use crossterm_winapi::{Console, Handle, InputRecord};

use crate::event::{sys::windows::poll::WinApiPoll, Event};

Expand Down Expand Up @@ -36,10 +36,10 @@ impl EventSource for WindowsEventSource {
if let Some(event_ready) = self.poll.poll(poll_timeout.leftover())? {
if event_ready && self.console.number_of_console_input_events()? != 0 {
let event = match self.console.read_single_input_event()? {
InputEvent::KeyEvent(record) => handle_key_event(record)?,
InputEvent::MouseEvent(record) => handle_mouse_event(record)?,
InputEvent::WindowBufferSizeEvent(record) => {
Some(Event::Resize(record.size.x, record.size.y))
InputRecord::KeyEvent(record) => handle_key_event(record)?,
InputRecord::MouseEvent(record) => handle_mouse_event(record)?,
InputRecord::WindowBufferSizeEvent(record) => {
Some(Event::Resize(record.size.x as u16, record.size.y as u16))
}
_ => None,
};
Expand Down
2 changes: 1 addition & 1 deletion src/event/sys/windows/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ fn parse_key_event_record(key_event: &KeyEventRecord) -> Option<KeyEvent> {
VK_INSERT => Some(KeyCode::Insert),
_ => {
// Modifier Keys (Ctrl, Alt, Shift) Support
let character_raw = { (unsafe { *key_event.u_char.UnicodeChar() } as u16) };
let character_raw = key_event.u_char;

if character_raw < 255 {
let mut character = character_raw as u8 as char;
Expand Down

0 comments on commit 75c59f3

Please sign in to comment.