mirror of
https://github.com/talwat/lowfi
synced 2024-12-25 10:41:54 +00:00
fix: ignore release key events
This commit is contained in:
parent
a64b10e20c
commit
30af38a63a
@ -1,6 +1,6 @@
|
||||
use std::sync::atomic::Ordering;
|
||||
|
||||
use crossterm::event::{self, EventStream, KeyCode, KeyModifiers};
|
||||
use crossterm::event::{self, EventStream, KeyCode, KeyEventKind, KeyModifiers};
|
||||
use futures::{FutureExt, StreamExt};
|
||||
use tokio::sync::mpsc::Sender;
|
||||
|
||||
@ -17,6 +17,10 @@ pub async fn listen(sender: Sender<Messages>) -> eyre::Result<()> {
|
||||
continue;
|
||||
};
|
||||
|
||||
if event.kind == KeyEventKind::Release {
|
||||
continue;
|
||||
}
|
||||
|
||||
let messages = match event.code {
|
||||
// Arrow key volume controls.
|
||||
KeyCode::Up => Messages::ChangeVolume(0.1),
|
||||
|
Loading…
Reference in New Issue
Block a user