Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Dec 2002
    Location
    Southampton, England
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question C: Getting a char from keyboard without enter?

    I am using a linux box Red Hat 8.0, and need to write a small C prog that gets a single char from the keyboard without pressing enter.

    On some platforms getch() (from connio.h) does this, but this does not exist on the box I am using?

    What header file doe I need in Linux and what function do I need to use??

    Thanks,

    Lloyd

  • #2
    New Coder
    Join Date
    Dec 2002
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It doesn't appear that linux is capable of that in it's default mode. check out this link to find out why:http://www.ale.org/archive/ale/ale-2.../msg00442.html
    -Dan

  • #3
    New to the CF scene
    Join Date
    Dec 2002
    Location
    Southampton, England
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Doesn't Compile

    Thanks for the link - at least I now know the problem, but for some reason I can't get that code compiling on my Linux box.

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    The Netherlands
    Posts
    217
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You could use ncurses.
    Btw why is it so important that you don't have to press enter?If you use the C++ function getline,you can speficy some other character than return.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •