<div dir="ltr"><div dir="ltr"><div>I have an application that is used as a control system for a 
presentation, under Linux and using X11. I have a USB presentation 
remote that acts as a very miniature keyboard (four buttons: Page Up, 
Page Down, and two others) which can be used to advance and go back in 
the presentation. I would like to have my presentation application to 
receive all of the events from this remote regardless of where the mouse
 focus is. But I would also like to be able to receive the normal mouse 
and keyboard events if the current window focus is on the presentation 
application. Using <code>XIGrabDevice()</code> I was able to receive all
 events from the remote in the presentation application regardless of 
the current focus but I was not able to receive any events from the 
mouse or other keyboard while the grab was active. Is what I'm trying to do possible?</div><div><br></div><div>Here's the code I'm using:</div><div><br></div><div>XIEventMask masks[1];<br>unsigned char mask[(XI_LASTEVENT+7)/8];<br>memset(mask, 0, sizeof(mask));<br>XISetMask(mask, XI_KeyPress);<br>masks[0].deviceid = XIAllMasterDevices;<br>masks[0].mask_len = sizeof(mask);<br>masks[0].mask = mask;<br>Status result = XIGrabDevice(dpy, deviceid, win, CurrentTime, None, XIGrabModeAsync, XIGrabModeAsync, True, masks);<br></div><div><br></div><div>Any help would be appreciated. Thank you.</div><div><br></div><div>Eric<br></div></div></div>