Re: Polling for keypress

From: Floyd L. Davidson (
Date: 10/08/04

  • Next message: Pascal Bourguignon: "Re: Lex/YACC"
    Date: Thu, 07 Oct 2004 15:55:29 -0800

    "John Smith" <> wrote:
    >Thanks to both of you.
    >I tried both implementations and ended up using the one from Heiko because
    >even though the other was more clean it had bugs. The code Heiko posted

    I would be very interested in what you think is a bug in it! It
    has been being posted to Usenet for many years and evolved from
    pre-POSIX code to where now it a POSIX demo.

    What kind of problem did you encounter? And the big question
    is, did the silly demo program work?

    >works flawless though and sticks to the same specification as the function
    >in Windows.
    >But I'm curious. Isn't there a unix alternative way to perform the same

    The problem is that there are many alternate _tasks_, not just
    the one the Window's version addresses.

    The advantage of Heiko's code, for you, is exactly as you've
    stated because it accomplishes what you understand is needed.

    The advantage of the code that I posted is that it was meant
    (for Unix, not Windows) to be a demo, not just a drop in
    replacement, showing how to program that functionality on a Unix
    platform. It is modularized and could be put into a library
    because does not require global variables nor does it leave the
    terminal in a odd state between calls. Also the kbhit() and
    getch() functions are not tied at the hip, and in fact the
    kbhit() function is unnecessary!

    FloydL. Davidson           <>
    Ukpeagvik (Barrow, Alaska)               

  • Next message: Pascal Bourguignon: "Re: Lex/YACC"

    Relevant Pages

    • Re: Polling for keypress
      ... The code Heiko posted ... > (for Unix, not Windows) to be a demo, not just a drop in ... showing how to program that functionality on a Unix ... > kbhit() function is unnecessary! ...
    • New module proposal: Convert::TimeUnits
      ... Convert::TimeUnits provides the Unix unitsfunctionality to Perl, ... gunitsstyle conversions of more than one unit into the desired unit. ... values as a hash reference or Convert::TimeUnits object. ...
    • RE: NT/2000 vs Unix based Web Servers
      ... Functionality is the next question. ... Unix systems like Sun or Linux ... Just secure it if you are worried about the security. ... the more basic web site, with Java, Perl and/or similar. ...
    • Re: How to change peoples minds about LISP?
      ... >Why are so few system administrators using Lisp as a gluing language, ... directly mapped to the Unix function and using FFI arguments). ... a new potential Lisp programmer who wants to use CMU CL instead of C ... Contrast this with Perl, which, in addition to its main functionality ...
    • Re: Mono and D8 .NET
      ... The new strategy to implement System.Drawing is to use the GDI+ API on Unix and implement the GDI+ C Flat API on top of the cairo library. ... The bad news is that there are many regressions on this release related to using System.Drawing and Windows.Forms on Unix. ... lot of the functionality we had, and we will be working hard to address ...