<div id="RTEContent">I have a program that attemps to detect user inactivity with the following code.<br>  <br>  &nbsp;use Term::Readkey;<br>    &nbsp;&nbsp;&nbsp;&nbsp; ReadMode('cbreak');<br>    &nbsp;&nbsp;&nbsp; unless(my $key = ReadkKey(20)) { <br>    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # no key was pressed. do something<br>  &nbsp;&nbsp;&nbsp; } else {<br>    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # key was pressed<br>    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ReadMode('normal');<br>    &nbsp;&nbsp;&nbsp; }<br>  <br>  It works as intedended except for one important defect.&nbsp; The first  keystroke that triggers the else gets lost.&nbsp; I've tried adding  print $key; after the Readmode('normal') line (in the else) which puts  the output on the screen, but this seems to not have the same affect as  the keystroke acctually being typed when ReadMode is normal.&nbsp; Does  anyone know how I can recreate that lost keystroke.&nbsp; Any help  would be greatly appreciated.<br>  <br> 
 Happy New Year.<br>  <br>  Richard<br>  </div><BR><BR>A people that values its privileges above its principles soon loses both.<br> -Dwight D. Eisenhower.