PDA

View Full Version : getchar()



mickey
9th October 2006, 16:25
hi,
I need a function like getchar() (not QT class); but when I press a char, It should be gon on (and not waiting for enter button). Is there that? thanks

gfunk
9th October 2006, 23:59
http://doc.trolltech.com/3.3/qkeyevent.html

mickey
10th October 2006, 00:42
sorry but I was looking for a not QT function....

munna
10th October 2006, 08:52
This (http://www.cplusplus.com/ref/cstdio/getchar.html) might help

mickey
10th October 2006, 20:14
I don't understand how......It go out from the cycle with . but I need don't press <enter> key...

brcain
20th October 2006, 17:08
For Windows only ... there's _getch(). The function only waits for a single keypress, it does not wait until ENTER has been pressed.

You'll find it in conio.h
int _getch(void);

Let me know if you find a more portable version. I've been looking for a non-Qt solution also.

wysota
20th October 2006, 18:37
AFAIK it can be done with readline or ncurses libraries, plain C++ won't do what you require.