Non-blocking keyboard peek

Adrian May adrian.may at web.de
Thu Oct 2 12:32:37 EDT 2003


Hi folks,

I have simulator which should grind away all night but check the keyboard once per iteration to see if I'm trying to view the results, change parameters or terminate it. Therefore I need a non-blocking keyboard peek function. So far, my searching only lead to some stuff about using threads in GHC but that seems far too complicated and messy. I have no reason to open a new thread and would still have to fight over some resource lock at the very position in the program where I would normally have just peeked at the keyboard and maybe called the menu procedure. I don't think such a peek function would affect referential transparency or be considered gauche for any other reason.

Does it really not exist? Can I write it for a reasonable amount of effort?

Thanks in advance,
AM

PS. This is the second of these mails I sent 'cos the first one just didnt show up on the list.  


______________________________________________________________________________
Zwei Mal Platz 1 mit dem jeweils besten Testergebnis! WEB.DE FreeMail
und WEB.DE Club bei Stiftung Warentest! http://f.web.de/?mc=021183



More information about the Haskell-Cafe mailing list