Results 1 to 5 of 5

Thread: Get a single character from stdin without hitting ENTER, need help.

  1. #1
    Join Date
    Dec 2007
    Beans
    9

    Get a single character from stdin without hitting ENTER, need help.

    Im new to C programming under Linux environment. Im trying to write a simple program that can test my keyboard. To do that, i wanna get a single character from stdin (when i press a button) and print it on the screen of the terminal, but without having to press an extra ENTER. I've used getc, getchar, getch (ncurses.h), but none of them working. Someone know the solution for my case? Any help will be appreciated. Thanks for reading my question.

  2. #2
    Join Date
    Apr 2008
    Location
    Bangalore, India
    Beans
    250
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Get a single character from stdin without hitting ENTER, need help.


  3. #3
    Join Date
    Dec 2007
    Beans
    9

    Re: Get a single character from stdin without hitting ENTER, need help.

    Ok, i'll try it. Thanks for your reply.

  4. #4
    Join Date
    Nov 2005
    Location
    MINNESOTA!
    Beans
    241
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Get a single character from stdin without hitting ENTER, need help.

    in the future, try http://ubuntuforums.org/forumdisplay.php?f=39 .... it's a different sub-forum of this site and it's really good for programming help. the people that look at it are very good and very helpful.

  5. #5
    Join Date
    Dec 2007
    Beans
    9

    Re: Get a single character from stdin without hitting ENTER, need help.

    Oh right, I didnt see the sub-forum when i started the topic. I'll try in the right place from now on. Thanks for your reply, rajan.

Bookmarks

Posting Permissions

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