开发者

Getting X window id for GLUT program? or, How to remote control a GLUT program on X?

开发者 https://www.devze.com 2022-12-19 16:47 出处:网络
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 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?


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 ...

Update: xdotool actually contains powerful search functionality, which recent versions make even easier to use. It doesn't make sense to use xtrace like this, just use xdotool search instead

0

精彩评论

暂无评论...
验证码 换一张
取 消