0

I want to create a process in Linux which waits for some particular keys to be pressed and executes a snippet of code and goes back to sleep. How can I achieve this?

  1. Initially a process will be in sleep mode
  2. Wakes up when certain Keys are Pressed
  3. Executes a piece of Code
  4. Goes back to sleep

Additional questions

  • I know I can create a daemon process for it but how can I get notification for those keystrokes?
  • Do I need to create an interrupt routine for this?
  • Is there a way to register a process for event notification(s) in Linux as in Android?
slm
  • 363,520
  • 117
  • 767
  • 871
Vishwanath gowda k
  • 594
  • 1
  • 5
  • 11

0 Answers0