Path: utzoo!mnetor!uunet!husc6!bloom-beacon!mit-eddie!uw-beaver!cornell!rochester!pt.cs.cmu.edu!andrew.cmu.edu!aw0i+ From: aw0i+@andrew.cmu.edu (Andrew Jordan Werth) Newsgroups: comp.sys.amiga Subject: Help with messages, ports, etc. Message-ID: Date: 20 Apr 88 14:06:40 GMT Organization: Carnegie Mellon University Lines: 21 I have some questions about writing C programs which use messages, ports, etc. I can't seem to find some really clear source code to help me out, either... 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 long it has taken since the last non-null event, but that doesn't work for two reasons: 1) It's bad for the system because I think it eats up lots of time; on a different level, 2) because it only works when the user has my window selected. How do I set up a message port which can detect input from any window whether or not my own program is actually active? Do I need to do this? Should I use the timer device at all (and if so, how? There's not much good source code around to play with...) Also, what is a way to detect the input without slowing down the whole machine? All help appreciated. Thanks. Andrew Werth aw0i@andrew.cmu.edu