Re: Input timeout

2013-05-14 Thread Adam D. Ruppe
On Tuesday, 14 May 2013 at 03:50:22 UTC, Josh wrote: Is there a way in D to only accept input for a certain time, instead of std.stdio.readln's behaviour? Something like "Press a key in 3 seconds to abort". see also this thread: http://forum.dlang.org/thread/vavskrvzebozkreub...@forum.dlang.or

Re: Input timeout

2013-05-13 Thread Ali Çehreli
On 05/13/2013 09:22 PM, Josh wrote: > Your answer requires the user to > press enter to send the line. Would it be possible to have getch-like > behaviour without using C, or would that be the only way? I don't know how to set stdin to non-blocking mode in D. However, if you are sure that stdin

Re: Input timeout

2013-05-13 Thread Josh
On Tuesday, 14 May 2013 at 04:14:27 UTC, Ali Çehreli wrote: On 05/13/2013 08:50 PM, Josh wrote: Is there a way in D to only accept input for a certain time, instead of std.stdio.readln's behaviour? Something like "Press a key in 3 seconds to abort". Thanks Josh An unlikely solution is std.

Re: Input timeout

2013-05-13 Thread Ali Çehreli
On 05/13/2013 08:50 PM, Josh wrote: Is there a way in D to only accept input for a certain time, instead of std.stdio.readln's behaviour? Something like "Press a key in 3 seconds to abort". Thanks Josh An unlikely solution is std.concurrency because it already has a timeout facility: impor

Input timeout

2013-05-13 Thread Josh
Is there a way in D to only accept input for a certain time, instead of std.stdio.readln's behaviour? Something like "Press a key in 3 seconds to abort". Thanks Josh