tags:

views:

122

answers:

2

I am trying to write a c++ program that responds to keyboard input. I want to run this as a daemon so I can't use cin, I would also like to output each character as it is pressed to a picoLCD screen that I have set up. What is the best way to do this?

+1  A: 

If the application is running in the background as a daemon, you can use the common Windows approach of a "keyboard hook". This is performed much differently on Linux though and there are various methods you may want to look into.

It is discussed a bit in this SO question: http://stackoverflow.com/questions/144901/system-wide-keyboard-hook-on-x-under-linux

John T
Thanks not exactly what I am looking for but got me on the right track
A: 

Depends on the Framework API and OS, but the picoLCD states that it should show up as a standard keyboard (or HID) device. If straight C/C++ getchar() or cin.

kenny