Jump to content




Block Read()


  • You cannot reply to this topic
1 reply to this topic

#1 svdragster

  • Members
  • 222 posts
  • LocationGermany

Posted 10 August 2013 - 07:43 AM

Hey,

I'm doing some coroutine stuff, and I'm running the shell while another program is running in the background.
I can switch between them with pressing TAB. Everything works great, except that I can still type stuff to the screen.
I have overwritten the read an write functions, so it won't print anything of them, but I can't find out how I can block read().

Can anyone help me block read() so it won't do anything as long as a bool is true?

#2 Bubba

    Use Code Tags!

  • Moderators
  • 1,142 posts
  • LocationRHIT

Posted 10 August 2013 - 09:42 AM

If you don't want to stop programs that use timers from running, just make sure that key and character events go only to the currently active coroutine, but let all the other events to go to every coroutine. That way, timers and other events like redstone will continue to work with background programs, but typing will only go to the forefront program.

If you want background programs to actually stop, then only resume the active coroutine.





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users