Thread: Reading single character in linux

  1. #1
    Registered User
    Join Date
    Mar 2002
    Posts
    2

    Reading single character in linux

    In linux...how can my c program get a single character from a keyboard without hitting 'Enter'(newline)???

  2. #2
    Registered User rohit's Avatar
    Join Date
    Feb 2002
    Posts
    69
    getchar,getche, getch functions i think can do that ...

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    You have to make stdin unbuffered

    Try
    setbuf
    setvbuf

    Or looking at termios

  4. #4
    Registered User
    Join Date
    Oct 2001
    Posts
    197
    getch() , getche() arenīt ANSII-conform!!

    klausi
    When I close my eyes nobody can see me...

  5. #5
    Registered User PutoAmo's Avatar
    Join Date
    Mar 2002
    Posts
    72

    Non Canonical

    You have to go into noncanonical mode. default is canonical

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Pseudo TTY not reading singal character
    By MrUmunhum in forum Linux Programming
    Replies: 0
    Last Post: 11-18-2008, 07:02 PM
  2. Replies: 26
    Last Post: 11-30-2007, 03:51 AM
  3. Please Help - Problem with Compilers
    By toonlover in forum C++ Programming
    Replies: 5
    Last Post: 07-23-2005, 10:03 AM
  4. reading a character
    By Calavera in forum C Programming
    Replies: 6
    Last Post: 11-23-2004, 12:25 PM
  5. Character handling help
    By vandalay in forum C Programming
    Replies: 18
    Last Post: 03-29-2004, 05:32 PM