From 215b88f6e847f079bd791e19970fb175869b19a1 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sat, 23 Dec 2023 14:29:09 +0000 Subject: [PATCH] Looks as if this is the best way to go beep! --- src/main.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 22fc65c..e3d9595 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,6 +2,7 @@ use mastodonochrome::OurError; use mastodonochrome::auth::AuthConfig; use std::io::Read; +use std::io::Write; use crossterm::{ event::{self, Event, KeyCode, KeyEventKind}, @@ -95,10 +96,12 @@ fn main() -> std::io::Result<()> { dbg!(&ev); match ev { Event::Key(key) => { - if key.kind == KeyEventKind::Press - && key.code == KeyCode::Char('q') - { - break; + if key.kind == KeyEventKind::Press { + if key.code == KeyCode::Char('q') { + break; + } else if key.code == KeyCode::Char('b') { + stdout().write(b"\x07")?; + } } }, _ => (), -- 2.30.2