Re: C question

From: Benjamin J. Weiss (benjamin_at_Weiss.name)
Date: 08/02/03

  • Next message: Jonathan Bartlett: "Re: C question"
    To: redhat-list@redhat.com
    Date: Sat, 2 Aug 2003 09:20:35 -0500 (CDT)
    
    

    On Sat, 2 Aug 2003, Buz Davis wrote:

    > I would like a routine to read the keyboard and report the single key
    > pressed,
    > and give me control back without waiting for ENTER to be pressed.
    > Under MSDOS (where all of my c experience has been) there was a c
    > routine
    > called getch() that would do just this. I can't seem to find one under
    > Linux.

    Okay, this is going to be an unorthodox answer, but it may get you where
    you need to go...

    If your program is only going to run on PC's, you can always go to the
    BIOS memory. I can't remember the exact address (though I'll look it up
    when I get home, if you like) but the BIOS has a keyboard buffer and two
    pointers. When I was writing a video game way back in '91-'92, we took
    control of the buffer and buffer pointers with C pointers, and it worked
    great!

    Of course, you'd have no portability....

    Ben

    -- 
    redhat-list mailing list
    unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
    https://www.redhat.com/mailman/listinfo/redhat-list
    

  • Next message: Jonathan Bartlett: "Re: C question"

    Relevant Pages