From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e759c9142eba3ec1 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-02-22 13:26:18 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!crtntx1-snh1.gtei.net!news.gtei.net!newsfeed1.easynews.com!easynews.com!easynews!feed2.news.rcn.net!feed1.news.rcn.net!rcn!logbridge.uoregon.edu!arclight.uoregon.edu!wn54feed!worldnet.att.net!attbi_s01.POSTED!not-for-mail Message-ID: <40391F75.460CFD34@mchsi.com> From: Bruce or Tracy Jacobs Reply-To: bruce.tracy@the-jacobs.org X-Mailer: Mozilla 4.7 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Keyboard Polling Solution References: <4033DB01.2CE34E32@me.org> <4034A229.8080403@noplace.com> <40354027.C7D28149@mchsi.com> <4035FA69.1060301@noplace.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 12.218.74.234 X-Complaints-To: abuse@mchsi.com X-Trace: attbi_s01 1077485177 12.218.74.234 (Sun, 22 Feb 2004 21:26:17 GMT) NNTP-Posting-Date: Sun, 22 Feb 2004 21:26:17 GMT Organization: MediaCom High Speed Internet Date: Sun, 22 Feb 2004 21:26:17 GMT Xref: archiver1.google.com comp.lang.ada:5734 Date: 2004-02-22T21:26:17+00:00 List-Id: I am playing with an Ada OpenGL graphics program that allows the user to manipulate output graphics (zoom in, out, move around, etc) but I didn't want the entire program to stop and wait for input because it needs to stay busy doing things. Marin David Condic wrote: > > Well, there you go! I have not messed with any keyboard input in so long > I'd completely forgotten about that. But yes, that looks like it would > do the job. > > I'd be curious why you want to poll. Usually, one tries to avoid that, > but I know I've wanted something going on in the background that might > stop when the user hit a key. The usual trick would be to have a task > looking at keyboard input with another task doing the background job. > Sometimes this wouldn't work with some implementations because the I/O > operation didn't flag the task as "blocked", so the background would > starve. Then you might want to resort to some kind of polling. > > MDC > > Bruce or Tracy Jacobs wrote: > > A version of Get_Immediate does this. If there is nothing in the > > buffer, it returns > > FALSE and lets you continue on. > > > > -- > ====================================================================== > Marin David Condic > I work for: http://www.belcan.com/ > My project is: http://www.jsf.mil/NSFrames.htm > > Send Replies To: m o d c @ a m o g > c n i c . r > > "Face it ladies, its not the dress that makes you look fat. > Its the FAT that makes you look fat." > > -- Al Bundy > > ======================================================================