获取 GLUT 程序的 X 窗口 ID?或者,如何远程控制 X 上的 GLUT 程序?

发布于 2024-08-20 15:20:39 字数 445 浏览 5 评论 0原文

我想向 X11 上的 GLUT 程序发送击键,但我找不到附加到 GLUT 程序的 X11 客户端。

我这样做,使用了最优秀的花栗鼠 2d 物理包演示程序:

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

并且没有区别。

我最终的希望是我可以通过发送相当于以下内容的关键事件来控制 GLUT 程序:

xdotool key --window 0x4000002 a

所以我的问题:

  1. 如何远程控制在 linux/X11 上运行的 GLUT 程序?
  2. 有没有办法获取 GLUT 程序的 X11 窗口 ID?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

娇俏 2024-08-27 15:20:39

安装 xtrace,然后:

在终端 1 中:

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

在终端 2 中:

DISPLAY=:8chipmunk_demos

您应该得到一行:

... CreateWindow height=0x18 window=0x04a00002 ...

<更新: xdotool 实际上包含强大的搜索功能,最新版本使其更易于使用。像这样使用xtrace没有意义,只需使用xdotool search代替

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文