Is there any way of getting input directly from keyboard without it getting written onto screen?

I tried the standard O/I functions, but they don't help. I also looked into C libraries, but there wasn't and useful function (unless I missed some).

I need only one one key from keyboard, so I use getchar() now. The program is dependant on what key the user presses.

5 Years
Discussion Span
Last Post by WaltP

There are a couple options
1. If your compiler supports conio.h then it contains a couple functions that will do what you want.

2. Use OS-specific api functions. For MS-Windows there are some console functions you can use (link here)


The first option fixed my problem. Thank you.

I need to make one of my functions run faster, (because the game is very dependant on how quickly it runs) can I post it here or should I go elsewhere?

Edited by Purlox: n/a


You don't have to. I decided that I will post it later, because I don't know one important thing in C. And that thing could be the cause, why I can't make it faster. If it won't help, then I will post in this forum.

In other words this tread can be locked.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.