954,500 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Reading keyboard from background process

Hi, I need to check keys pressed in another process. How can I it reach? I'm writing simple utility for linux/debian, which runs video player in process no.1. On background is another process, which will read pressed keys and will interact with the 1st process. Problem is, that it cant be solved thru threads - the player is executed by system() function, which runs new shell. So the my key's reader must be separate process.

Thank very much for your help,
Perun

perun_x
Newbie Poster
2 posts since Aug 2008
Reputation Points: 10
Solved Threads: 0
 

What about making the foreground process as observer of background process?

chanderk
Newbie Poster
14 posts since May 2008
Reputation Points: 10
Solved Threads: 0
 

How do u mean this? Make the video player as background and the controller process on foreground. It's possible, but problem is, that I don't know how to read keyboard. I'm a Windows programmer... I don't know, which library, class or function to use for listening events. And also don't know, how to switch process to background/foreground. Could you give me a clue or some useful web link?

Thanx very much

perun_x
Newbie Poster
2 posts since Aug 2008
Reputation Points: 10
Solved Threads: 0
 

use sockets (or pipes) to communicate keystrokes from one process to the other.

vijayan121
Posting Virtuoso
1,606 posts since Dec 2006
Reputation Points: 1,159
Solved Threads: 287
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You