Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!mordor!sri-spam!ames!pasteur!ucbvax!CORY.BERKELEY.EDU!dillon From: dillon@CORY.BERKELEY.EDU (Matt Dillon) Newsgroups: comp.sys.amiga Subject: Re: Help with messages, ports, etc. Message-ID: <8804201853.AA13956@cory.Berkeley.EDU> Date: 20 Apr 88 18:53:19 GMT Sender: daemon@ucbvax.BERKELEY.EDU Lines: 22 :Basically, I want to add a feature to a program which blanks the screen after a :specified amount of time. I am having problems in determining whether the user :is doing anything with the keyboard or mouse. :I originally thought I could put a loop of GetMsg's and keep track of how... What you are suggesting will never work... but there is a really easy way to do it! The standard solution is to add your own input handler to the system ... usually before intuition (priority 51+). This input handler would receive ALL raw mouse and keyboard events, as well as timer events every 1/10 second. Every event is timestamped, and since timer events come in continuously, you do not need to open the timer.device or anything like that. Essentially: READ RKM I about the INPUT.DEVICE READ the commented .H header files for the event structure then write a program which opens the input.device, adds your handler, then waits around for handler to signal it to do something. I will post a sample program as soon as I get home. -Matt