Ubuntu Forums Archive Viewer

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

Archived thread 1040810 from Education & Science. Markdown source: Education_&_Science/thread_1040810_Get_a_single_character_from_stdin_without_hitting_.md

Original URL About this archive
#1

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
#3

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

#4

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

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.