In file input.h:

void inp_timeout

(int msec, int intrusive)

Set user input timeout.

Documentation

Set user input timeout.

This one allows getinput() to timeout for some reason or other. Not recommended as it doesn't fit in with the entire BBS philosophy, but there are applications (like MUDs or the adventure module) where this is needed.

Parameters:
msec - the number of milliseconds (ms) after which to terminate (this is accurate to at most 10 ms, the delay between checks for new keyboard input).
intrusive - supply a non-zero value for intrusive to cause getinput() to terminate even if the user has started typing something. The default behaviour, intrusive=0 is to only timeout if the user is 100% idle (empty input line). Intrusive mode is not recommended, as it interrupts the user --- the system should never interrupt the user unless there's a good reason. Upon timeout, global variables inptimeout_msec and inptimeout_intrusive are reset to 0. This is the official method of checking whether getinput() has timed out. Variable inptimeout_msec is used as a counter by inputstring(). This means you have to call setinputtimeout() before every call to getinput() that needs a timeout.

Alphabetic index



This page was generated with the help of DOC++.