Async read with Termion

Hello, I got some troubles, to get stdin working in a specific thread only...
(intorawmode of course ) and the termion::async_stdin() official exemple of the crateio doesn't help me much, when you run in a thread...
so any one can write me some few base code lines svp ? ...on which I can keep growing ... :slight_smile:
For now im on the end chapter 16 of the rust cookbook but im not strong enough (yet I hope) to handling the Termion doc... so that will be a great help ! (my goal is to grab the ascii char in a thread and push it on the heap from another thread (all of this is ok for me) but handling stdin only in a specific thread in non blocking way that's what I don't understand
:slight_smile: so :crossed_fingers:

1 Like

I don't really know what your question is. Reading stdin should work from any thread.

Well simple, when I call a read from std::io::stdin().read(&mut buffer) the stdout is block and wait for my input... so other thread running can't refresh the stdout even with termion, so my question is how is it possible to simply grab some ascii keys from the keyboard and so driving my threads via mpsc or mutex which would be simple for me after that...

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.