> Dear FLTK experts,
> is there a straigthforward way of doing a timeout if no input 
> events occured for some timespan - lets say 5 minutes?
> 
> i have to develop an application for a touchscreen terminal, 
> and it should timeout and return to a startscreen if no user 
> input happens for a while.
> i could of course just check for myself if the mouse was 
> moved or the touchscreen (left mousebutton) was pressed and 
> reset a timer, but maybe there is some function in fltk that 
> does this already out of the box?


I don't think there's any specific function for this - when I did
something similar, I wrote a little wrapper function something like
this: (dodgy pseudo code follows...)

  void reset_timeout(void){
    Fl::remove_timeout(...);
    Fl::add_timeout(300, ...);
  }

And called that *often*, whenever there was some user-interaction that
needed handling.

When the timeout did fire, it's callback function took me back to an
init screen. 
I guess that's something like what you need?
Not elegant, but it did work...





SELEX Sensors and Airborne Systems Limited
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 
3EL
A company registered in England & Wales.  Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to