When I am translating movies, I write the text on my PC (in OpenOffice), while I play the video on my laptop if MPlayer, using SPACE and arrow to pause, advance the video. Both computers have Ubuntu Linux installed on them.
When you translate the movie, you use pausing and skipping few seconds forward/backward very often. I'd like to make my life simpler. I want to control my laptop from my main computer in the following way: When translating the movie, my computer's OpenOffice would work as normal except that the computer would recognize three special keystrokes (for example Ctrl+Right, Ctrl+Left, Ctrl+Space) which would skip and pause the video on the second computer (the laptop) so that I wouldn't have to move my hands between two keyboards.
Controlling the MPlayer on laptop from the main computer is actually very easy. I can just open the SSH connection to laptop, start MPlayer there using "-slave" and then send ASCII commands to control it. Or I can use the MPlayer's remote control capabilities. Anyway, this part is easy. The problem I cannot easily solve is that the simple "control application" on my main computer (which I'd like to write in Ruby) has to somehow "grab" selected keyboard events even when it's not focused (because I am using the control keys while I am writing the translation in OpenOffice). I have do idea how this could be done in the simplest possible way (although I'm sure there are many ways to solve this).
Just to summarize: My problem is not with the video remote control itself. I just need some simple way my Ruby script can monitor the special keypresses without its window having to be active. So far I found out I can monitor "/dev/input/event0" and find the info there but this doesn't look very elegant and requires the script to have root privileges.