mirror of
https://github.com/ClementTsang/bottom.git
synced 2025-07-26 07:04:51 +02:00
Rename cevent to event.
This commit is contained in:
parent
26c1175a8a
commit
b26f2eca4e
@ -20,7 +20,7 @@ use std::{
|
|||||||
|
|
||||||
use crossterm::{
|
use crossterm::{
|
||||||
event::{
|
event::{
|
||||||
poll, read, DisableMouseCapture, EnableMouseCapture, Event as CEvent, KeyCode, KeyEvent,
|
poll, read, DisableMouseCapture, EnableMouseCapture, Event, KeyCode, KeyEvent,
|
||||||
KeyModifiers, MouseEvent,
|
KeyModifiers, MouseEvent,
|
||||||
},
|
},
|
||||||
execute,
|
execute,
|
||||||
@ -871,14 +871,14 @@ fn create_input_thread(
|
|||||||
loop {
|
loop {
|
||||||
if poll(Duration::from_millis(20)).is_ok() {
|
if poll(Duration::from_millis(20)).is_ok() {
|
||||||
if let Ok(event) = read() {
|
if let Ok(event) = read() {
|
||||||
if let CEvent::Key(key) = event {
|
if let Event::Key(key) = event {
|
||||||
if Instant::now().duration_since(keyboard_timer).as_millis() >= 20 {
|
if Instant::now().duration_since(keyboard_timer).as_millis() >= 20 {
|
||||||
if tx.send(BottomEvent::KeyInput(key)).is_err() {
|
if tx.send(BottomEvent::KeyInput(key)).is_err() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
keyboard_timer = Instant::now();
|
keyboard_timer = Instant::now();
|
||||||
}
|
}
|
||||||
} else if let CEvent::Mouse(mouse) = event {
|
} else if let Event::Mouse(mouse) = event {
|
||||||
if Instant::now().duration_since(mouse_timer).as_millis() >= 20 {
|
if Instant::now().duration_since(mouse_timer).as_millis() >= 20 {
|
||||||
if tx.send(BottomEvent::MouseInput(mouse)).is_err() {
|
if tx.send(BottomEvent::MouseInput(mouse)).is_err() {
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user