Re: Polling for keypress

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

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

    "John Smith" <john.smith@x-formation.com> 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
    >task?

    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           <http://web.newsguy.com/floyd_davidson>
    Ukpeagvik (Barrow, Alaska)                         floyd@barrow.com
    

  • 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! ...
      (comp.unix.programmer)
    • 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. ...
      (comp.lang.perl.modules)
    • 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. ...
      (Security-Basics)
    • 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 ...
      (comp.lang.lisp)
    • Re: few questions
      ... UNIX and VMS ... >> perform mostly the same functionality but do it in a different way ... plant floor controllers in real-time from both OpenVMS and UNIX ...
      (comp.os.vms)