Any X11 experts? XSendEvent -> xterm no workie

cracauer@

Developer
I have observed that for a long time and never understood why.

When sending KeyPress and KeyRelease events to X11 clients with XSendEvent(3), most clients work fine but some refuse to work. Let's say I send the "right arrow" key to emacs, that works, it moves the cursor to the right. If I send it to xterm (with an emacs inside or whatever), then it does not. I am aware that X11 clients have children and I need to find the right window ID in the tree to send to, but I tried all children.

The list of non-working clients includes: xterm, VMWare, Wine. I assume they do something special in reading the keyboard instead of just waiting for events. It's not an emergency since VNC works fine, so whatever client isn't cooperating I can route through VNC and then send the events to the VNC window.

But I am curious whether somebody can explain why exactly this is?
 
Ohhh, so that's the mess. I can set this flag in the sending control client (I think I tried that long ago) but it gets wiped out by the time it's received via XNextEvent in the client. I can see how hacking it up in LD_PRELOAD is one of the more straightforward solution.

Thanks so much.
 
Back
Top