Unwanted events from DVB remote

Dan Nicholson dbn.lists at gmail.com
Mon Apr 27 08:05:45 PDT 2009


On Mon, Apr 27, 2009 at 6:52 AM, Tony Houghton <h at realh.co.uk> wrote:
> On Sat, 25 Apr 2009 11:37:08 -0700
> Dan Nicholson <dbn.lists at gmail.com> wrote:
>
>> >> On Fri, Apr 24, 2009 at 8:59 AM, Tony Houghton <h at realh.co.uk> wrote:
>> >> > My DVB card has a remote control which Linux sees as an input device. I
>> >> > want to be able to use it by reading its /dev/input/event* node
>> >> > directly, but there are unwanted side effects because it also generates
>> >> > events on /dev/console for certain keys which have analogues on a
>> >> > standard keyboard and pressing its power button causes a shutdown.
>
> [Snip]
>
>> Well, if you're not going to use the device through X, then you can
>> just have X ignore it.
>>
>> <remove key="input.x11_driver"/>
>
> Thanks, that does just what I want. I was wondering how I managed to
> miss that key, but it doesn't seem to be listed in hal-device for any
> devices.

Really? That's how the xserver decides whether it's going to use a
device or not. If none of your devices had that and you didn't have
static devices setup in xorg.conf, then you wouldn't get any X input
devices.

>> The grab is achieved through an ioctl with EVIOCGRAB (I think).
>
> I can't find documentation for that. Would I just call:
>
> ioctl(fd, EVIOCGRAB, NULL);

Looking at the evdev driver, I think you do:

ioctl(fd, EVIOCGRAB, (void *)1); /* grab */
ioctl(fd, EVIOCGRAB, (void *)0); /* release */

However, I should note that with a recent xserver and evdev driver,
you shouldn't have these kinds of issues. The evdev driver won't grab
the device and the server puts the console in RAW mode so that
characters don't leak there.

http://cgit.freedesktop.org/xorg/xserver/commit/?id=d936a4235c

This is in xorg-server-1.5.3.

--
Dan


More information about the hal mailing list