This commit is contained in:
Timon 2020-01-29 07:29:35 +01:00 committed by GitHub
parent f2fca91b30
commit 75c59f32ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 15 deletions

View File

@ -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`

View File

@ -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

View File

@ -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};
@ -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,
};

View File

@ -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;