Re: stdin help



sajjanharudit@xxxxxxxxx wrote:
> i need to check the stdin, repeatedly for an input form the keyboard,
> with out prompting the user to press a key or without returning pressed
> key on screen..
>
> now the problem is that if i use getc() the program execution stpos at
> this line and waits for the user to press a key. cant use getchar
> because the key pressed appears on the screen and moreover it is
> buffered.
>
> what i need is a small technique whereby which I can check the stdin
> for an input, without prompting the user(the user will enter a key as
> and when he wishes, not depending on the program) AND without halting
> the execution (as getc() does) AND without displaying the key on the
> screen AND should store the pressed key to variable

There is no way to do what you are looking for in Standard C but many
platforms provide non-blocking input handling functions that will allow
you to check if there is input waiting and act accordingly. You will
need to check your implementation's documentation or post to a group
that deals with your platform for the details.

Robert Gamble

.



Relevant Pages

  • stdin help
    ... i need to check the stdin, repeatedly for an input form the keyboard, ... with out prompting the user to press a key or without returning pressed ... now the problem is that if i use getcthe program execution stpos at ...
    (comp.lang.c)
  • Re: stdin help
    ... > i need to check the stdin, repeatedly for an input form the keyboard, ... > with out prompting the user to press a key or without returning pressed ... > screen AND should store the pressed key to variable ...
    (comp.lang.c)
  • Re: stdin help
    ... > i need to check the stdin, repeatedly for an input form the keyboard, ... > with out prompting the user to press a key or without returning pressed ... Your platform may ...
    (comp.lang.c)
  • Re: Check if process has a stdin handle
    ... Nikos Chantziaras wrote: ... # Is there a way to check if the current process has an stdin handle? ... # the win32 API, one can do: ... They might not run on all possible platforms, ...
    (comp.lang.c)
  • Re: Check if process has a stdin handle
    ... SM Ryan wrote: ... # Is there a way to check if the current process has an stdin handle? ... In # the win32 API, ... They might not run on all possible platforms, ...
    (comp.lang.c)