我尝试运行此主题中的代码(第一个答案):getting mouseclick coordinates with Xlib并且它给了我一些错误。
输出:
$ ./a.out
X Error of failed request: BadAccess (attempt to access private resource denied)
Major opcode of failed request: 2 (X_ChangeWindowAttributes)
Serial number of failed request: 8
Current serial number in output stream: 8
答案 0 :(得分:0)
应该使用:gcc c.cc -lX11
并将一个字符串更改为:XSelectInput(display, root, ButtonReleaseMask);