sleep and/or keyboard listen

ttcoder at ttcoder at
Sun Oct 17 15:49:32 CEST 2021

Indeed, and I have found that this article helped me to improve my code:

But if you're specifically after keyboard/mouse input, you'll probably want to do it with a 'sigh' instead of with polling: install a sigh (signal handler) for keyboard events, and implement its hook function ; e.g. I have this in my code:

class hog::InputBridger


private:  // Code

void handleOneEvent(

const Input::Event & ev


Genode::Entrypoint localEp;  // Genode thread dedicated to the sigh




void hog::InputBridger::handleInput()



[&] ( Input::Event const & ev )


... (handle mouse and keyboard events here)



serverInput.sigh( inputHandler );

Grepping the genode "repos/" folder will yield lots of examples.


You can wait by getting a Timer::Connection and using either the msleep() or usleep() method, depending on whether you have ms or us.

On Thu, Oct 14, 2021, 10:10 AM Kevin Burton <kevin.burton at> wrote:

Hello Genodians,

is it possible to have the main thread either sleep for a specific 
amount of time or have it wait for a keyboard input? If yes, how would I 
go about implementing it?

I have read online that the Timer service is in charge of sleeps, but I 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the users mailing list