C Input

I’d like to write a C program that runs in the background looking for
Keyboad inputs to the shell. Lets say the name of my program is “test” that
has a “getch” in it and I type

#test &

I’d like test to be able to detect keyboard inputs. Is there a way to do
this?

I would appreciate your suggestions.

Shashank

Shashank <sbalijepalli@precitech.com> wrote:

I’d like to write a C program that runs in the background looking for
Keyboad inputs to the shell. Lets say the name of my program is “test” that
has a “getch” in it and I type

#test &

I’d like test to be able to detect keyboard inputs. Is there a way to do
this?

The shell supplies nothing like this.

What are you trying to accomplish here? Are you trying to do it in a
Photon environment, or a text-mode console?

For text-mode, the console_*() functions might do what you want.

For Photon, getting/handling raw keyboard events might do what you want.

-David

David Gibbs
QNX Training Services
dagibbs@qnx.com