views:

133

answers:

1

I want to send a keystroke to a GLUT program on X11, but I can't find there's an X11 client attached to the GLUT program.

I do this, using the most excellent demo program for the chipmunk 2d physics package:

xlsclients -a|sort >aa
chipmunk_demos  (in another window)
xlsclients -a|sort >bb
diff aa bb

and there's no difference.

My eventual hope is that I can control the GLUT program by sending key events with the equivalent of:

xdotool key --window 0x4000002 a

So my questions:

  1. how can I remote control a GLUT program running on linux/X11?
  2. Is there a way to get an X11 window id for a GLUT program?
+1  A: 

Install xtrace, then:

In Terminal 1:

xtrace -d :0 -D :8 | grep CreateWindow

In Terminal 2:

DISPLAY=:8 chipmunk_demos

You should get a line with:

... CreateWindow depth=0x18 window=0x04a00002 ...

Nathan Kidd