You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to be able to prevent keypresses from being recognized before read_key() is actually called. Currently I'm doing the following:
let term = Term::stdout();
thread::sleep(Duration::from_secs(5));match term.read_key()? {
_ => ...}
I'd like for any keypresses that occur while the thread is asleep to not be registered, but if I press something during the timeout it still registers once the timeout is complete. I've tried calling flush(), but this seems to only affect stdout, not stdin:
let term = Term::stdout();
thread::sleep(Duration::from_secs(5));
term.flush()?;match term.read_key()? {
_ => ...}
Thoughts?
The text was updated successfully, but these errors were encountered:
I'd like to be able to prevent keypresses from being recognized before
read_key()
is actually called. Currently I'm doing the following:I'd like for any keypresses that occur while the thread is asleep to not be registered, but if I press something during the timeout it still registers once the timeout is complete. I've tried calling
flush()
, but this seems to only affect stdout, not stdin:Thoughts?
The text was updated successfully, but these errors were encountered: