on-internet
← Community

How can I reset wait/sleep time in Rust?

Stack Overflow ·

My program is intended to listen for keypresses (volume, brightness, etc.), and show an OSD popup (I use EWW widgets for that) that indicates volume/brightness levels, wait for N milliseconds, and then close the popup. I figured out how to listen to keypresses and execute shell commands. Here's almost what it looks like when you press the volume-down key: if event.event_type == KeyPress(VOL_DN) { osd_open("osd-vol"); //wait for N milliseconds; osd_close("osd-vol"); } I think there's a sleep() function of some sort? But I think it just stops the program execution until the wait time is over. He

Comments

Sign in or sign up to comment and upvote.

No comments yet.