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?

2 Answers2

3

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: system wide keyboard hook on X under linux

Community
  • 1
  • 1
John T
  • 23,207
  • 11
  • 54
  • 82
  • Thanks not exactly what I am looking for but got me on the right track –  Jul 09 '09 at 23:17
0

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
  • 20,210
  • 7
  • 48
  • 84