On Fri, Feb 24, 2012 at 03:09:05PM +0100, David Herrmann wrote: > Hi > > I am working on an input-driver for xorg and I was wondering how I can > add multiple FDs to be monitored for events? I can set pInfo->fd and > then call xf86AddEnabledDevice() but I need to watch multiple FDs for > my driver. Is there a simple way to do this?
xf86AddEnabledDevice doesn't really care about the pInfo struct other than to get the fd and use it as *closure pointer in your callback so the following should work. foreach fd: pInfo->fd = fd; xf86AddEnabledDevice(pInfo); of course, since the ReadInput hook doesn't give you the fd that had data available you'll need to work around that bit. the bigger question however is: why do you need multiple fd's, why you do you need a new input driver and is there some better way to fix this? some more information would help answering the last question. Cheers, Peter > Furthermore, setting pInfo->fd to an epoll-fd gives me weird behavior. > My callback gets called correctly but the call is delayed until > another input-device has also input available. > > Regards > David > _______________________________________________ > [email protected]: X.Org development > Archives: http://lists.x.org/archives/xorg-devel > Info: http://lists.x.org/mailman/listinfo/xorg-devel > _______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
