You are not logged in.

#1 2009-11-03 15:26:31

helpvampire
Member
Registered: 2009-08-10
Posts: 32

XTestFakeButtonEvent()

Since upgrading to xorg-server 1.7.1-1 XTestFakeButtonEvent() no longer works for me (used inside a C program).

As far as I can tell by reading the man page for XTestFakeButtonEvent nothing has changed but I want to make sure I am not making some mistake before submitting a bug report so I hope someone can verify that the code I am using is correct and reproduce the bug.

#include <X11/extensions/XTest.h>

int main()
{

Display *dpy;

dpy = XOpenDisplay(NULL);

XTestFakeButtonEvent(dpy, 8, True, CurrentTime);
XTestFakeButtonEvent(dpy, 8, False, CurrentTime);

XCloseDisplay(dpy);

return 0;

}

Compiled using -lXtst .

Here is the error I get:

X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  140 (XTEST)
  Minor opcode of failed request:  2 (X_XTestFakeInput)
  Value in failed request:  0x8
  Serial number of failed request:  11
  Current serial number in output stream:  14

As I said this worked perfectly before I upgraded. Also XTestFakeKeyEvent() still works fine.

Thanks a lot.

Offline

#2 2009-11-03 17:13:13

Blµb
Member
Registered: 2008-02-10
Posts: 224

Re: XTestFakeButtonEvent()

since the value 8 is the one it's complaining about, my guess would be that it now checks the # of buttons of the mouse it sends the event for, which doesn't have 8 buttons? tongue
Do common values (0, 1, 2) work? I'm using it successfully with these values. I'll try again later...

Last edited by Blµb (2009-11-03 17:14:14)


You know you're paranoid when you start thinking random letters while typing a password.
A good post about vim
Python has no multithreading.

Offline

#3 2009-11-03 17:27:46

helpvampire
Member
Registered: 2009-08-10
Posts: 32

Re: XTestFakeButtonEvent()

I tried it using 1 and it worked, but my mouse does have a button 8 and 9 , I tested it using xev.

Offline

#4 2009-11-03 17:34:58

helpvampire
Member
Registered: 2009-08-10
Posts: 32

Re: XTestFakeButtonEvent()

It works with 1, 2, 3, 4, 5, 6 and 7 but not 0, 8, or 9.

Offline

Board footer

Powered by FluxBB