Re: I don't want my IR handset to act like a keyboard

2010-01-12 Thread Éric Piel
Op 10-01-10 19:04, Tony Houghton schreef:
 I've got a DVB card with an IR controller which appears as an input
 device. I want my applications to read the input device directly, not as
 a keyboard. Among other reasons, it's because I want to use the OK
 button while mplayer is running, but it generates an Enter keypress
 which mplayer interprets as please quit.
 
Interestingly, someone has been complaining of exactly the opposite:
http://www.kernellabs.com/blog/?p=1309

Maybe in your case, what you need is just a special keymap for the
remote control, and make sure that applications listen to it only via X.

See you,
Eric

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


I don't want my IR handset to act like a keyboard

2010-01-12 Thread Tony Houghton
On Tue, 12 Jan 2010 19:25:11 +0100
Éric Piel e.a.b.p...@tudelft.nl wrote:

 Op 10-01-10 19:04, Tony Houghton schreef:
  I've got a DVB card with an IR controller which appears as an input
  device. I want my applications to read the input device directly, not as
  a keyboard. Among other reasons, it's because I want to use the OK
  button while mplayer is running, but it generates an Enter keypress
  which mplayer interprets as please quit.
  
 Interestingly, someone has been complaining of exactly the opposite:
 http://www.kernellabs.com/blog/?p=1309

That's obsolete too now, because of X not using hal any more.

 Maybe in your case, what you need is just a special keymap for the
 remote control, and make sure that applications listen to it only via X.

The trouble with that is that I like my application, boxstar, to handle
the remote presses and pass on commands to mplayer via its slave
interface, but mplayer grabs focus away from boxstar, depriving it of X
keyboard events. I don't want to have to rely on making special
exceptions in the window manager.

-- 
TH * http://www.realh.co.uk

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

Re: I don't want my IR handset to act like a keyboard

2010-01-12 Thread Paul Bender
On 1/12/2010 10:55 AM, Tony Houghton wrote:
 On Tue, 12 Jan 2010 19:25:11 +0100
 Éric Piele.a.b.p...@tudelft.nl  wrote:

 Op 10-01-10 19:04, Tony Houghton schreef:
 I've got a DVB card with an IR controller which appears as an input
 device. I want my applications to read the input device directly, not as
 a keyboard. Among other reasons, it's because I want to use the OK
 button while mplayer is running, but it generates an Enter keypress
 which mplayer interprets as please quit.

 Interestingly, someone has been complaining of exactly the opposite:
 http://www.kernellabs.com/blog/?p=1309

 That's obsolete too now, because of X not using hal any more.

 Maybe in your case, what you need is just a special keymap for the
 remote control, and make sure that applications listen to it only via X.

 The trouble with that is that I like my application, boxstar, to handle
 the remote presses and pass on commands to mplayer via its slave
 interface, but mplayer grabs focus away from boxstar, depriving it of X
 keyboard events. I don't want to have to rely on making special
 exceptions in the window manager.

My solution to this problem is customized udev scripts. Essentially, if 
the device is a remote, then udev does not set x11_driver. Since 
x11_driver is not set, Xorg ignores the device completely.
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

Re: I don't want my IR handset to act like a keyboard

2010-01-12 Thread Tony Houghton
On Tue, 12 Jan 2010 13:07:03 -0800
Paul Bender peben...@san.rr.com wrote:

 My solution to this problem is customized udev scripts. Essentially, if 
 the device is a remote, then udev does not set x11_driver. Since 
 x11_driver is not set, Xorg ignores the device completely.

Oh good, that is still possible. Could you tell me how? I couldn't work
out what to do, or even if there was anything I could do, from the udev
docs.

-- 
TH * http://www.realh.co.uk
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: I don't want my IR handset to act like a keyboard

2010-01-12 Thread Dan Nicholson
On Tue, Jan 12, 2010 at 2:50 PM, Tony Houghton h...@realh.co.uk wrote:
 On Tue, 12 Jan 2010 13:07:03 -0800
 Paul Bender peben...@san.rr.com wrote:

 My solution to this problem is customized udev scripts. Essentially, if
 the device is a remote, then udev does not set x11_driver. Since
 x11_driver is not set, Xorg ignores the device completely.

 Oh good, that is still possible. Could you tell me how? I couldn't work
 out what to do, or even if there was anything I could do, from the udev
 docs.

It's gone in master (and probably soon from debian/ubuntu). The server
just grabs everything marked with ID_INPUT by udev.

--
Dan
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: I don't want my IR handset to act like a keyboard

2010-01-12 Thread Tony Houghton
On Tue, 12 Jan 2010 14:55:09 -0800
Dan Nicholson dbn.li...@gmail.com wrote:

 On Tue, Jan 12, 2010 at 2:50 PM, Tony Houghton h...@realh.co.uk wrote:
  On Tue, 12 Jan 2010 13:07:03 -0800
  Paul Bender peben...@san.rr.com wrote:
 
  My solution to this problem is customized udev scripts. Essentially, if
  the device is a remote, then udev does not set x11_driver. Since
  x11_driver is not set, Xorg ignores the device completely.
 
  Oh good, that is still possible. Could you tell me how? I couldn't work
  out what to do, or even if there was anything I could do, from the udev
  docs.
 
 It's gone in master (and probably soon from debian/ubuntu). The server
 just grabs everything marked with ID_INPUT by udev.

And I suppose if I removed ID_INPUT I wouldn't get the events I want
from /dev/input/event* either.

-- 
TH * http://www.realh.co.uk
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: I don't want my IR handset to act like a keyboard

2010-01-12 Thread Paul Bender
On 1/12/2010 2:55 PM, Dan Nicholson wrote:
 On Tue, Jan 12, 2010 at 2:50 PM, Tony Houghtonh...@realh.co.uk  wrote:
 On Tue, 12 Jan 2010 13:07:03 -0800
 Paul Benderpeben...@san.rr.com  wrote:

 My solution to this problem is customized udev scripts. Essentially, if
 the device is a remote, then udev does not set x11_driver. Since
 x11_driver is not set, Xorg ignores the device completely.

 Oh good, that is still possible. Could you tell me how? I couldn't work
 out what to do, or even if there was anything I could do, from the udev
 docs.

 It's gone in master (and probably soon from debian/ubuntu). The server
 just grabs everything marked with ID_INPUT by udev.

As Xorg is not the only input device handler, this would seem to be a 
bug / design flaw that should be fixed before 1.8 is released. If not, 
distributions will need to hack around it in their udev scripts by 
clearing ID_INPUT whenever they do not want Xorg to grab the device.
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: I don't want my IR handset to act like a keyboard

2010-01-12 Thread Peter Hutterer
On Tue, Jan 12, 2010 at 06:26:58PM -0800, Paul Bender wrote:
 On 1/12/2010 2:55 PM, Dan Nicholson wrote:
  On Tue, Jan 12, 2010 at 2:50 PM, Tony Houghtonh...@realh.co.uk  wrote:
  On Tue, 12 Jan 2010 13:07:03 -0800
  Paul Benderpeben...@san.rr.com  wrote:
 
  My solution to this problem is customized udev scripts. Essentially, if
  the device is a remote, then udev does not set x11_driver. Since
  x11_driver is not set, Xorg ignores the device completely.
 
  Oh good, that is still possible. Could you tell me how? I couldn't work
  out what to do, or even if there was anything I could do, from the udev
  docs.
 
  It's gone in master (and probably soon from debian/ubuntu). The server
  just grabs everything marked with ID_INPUT by udev.
 
 As Xorg is not the only input device handler, this would seem to be a 
 bug / design flaw that should be fixed before 1.8 is released. If not, 
 distributions will need to hack around it in their udev scripts by 
 clearing ID_INPUT whenever they do not want Xorg to grab the device.

To add more detail to Dan's comment, the server ignores devices without
ID_INPUT set. Any device that has ID_INPUT set will be matched against the
input attributes in the xorg.conf.d and - if successful - added to the
server. If a device does not have a matching xorg.conf.d section or the
x11_driver already set by udev, it will not be added.

Cheers,
  Peter
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: I don't want my IR handset to act like a keyboard

2010-01-11 Thread Tino Keitel
On Sun, Jan 10, 2010 at 18:04:35 +, Tony Houghton wrote:
 I've got a DVB card with an IR controller which appears as an input
 device. I want my applications to read the input device directly, not as
 a keyboard. Among other reasons, it's because I want to use the OK
 button while mplayer is running, but it generates an Enter keypress
 which mplayer interprets as please quit.

You can use lirc to use the event device of the IR receiver and the
devinput driver in lirc to define what actions you want for keypresses.

There is also a tool called inputlirc, which acts like an lirc daemon
but is limited to input devices that send key events, like it's the
case in your setup.

Maybe you can also change the key events using the input-utils package.

Regards,
Tino
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: I don't want my IR handset to act like a keyboard

2010-01-11 Thread Tony Houghton
On Mon, 11 Jan 2010 00:02:32 +0100
Tino Keitel tino.keitel+x...@tikei.de wrote:

 On Sun, Jan 10, 2010 at 18:04:35 +, Tony Houghton wrote:
  I've got a DVB card with an IR controller which appears as an input
  device. I want my applications to read the input device directly, not as
  a keyboard. Among other reasons, it's because I want to use the OK
  button while mplayer is running, but it generates an Enter keypress
  which mplayer interprets as please quit.
 
 You can use lirc to use the event device of the IR receiver and the
 devinput driver in lirc to define what actions you want for keypresses.
 
 There is also a tool called inputlirc, which acts like an lirc daemon
 but is limited to input devices that send key events, like it's the
 case in your setup.

My problem isn't that I don't know how to make use of the events from
/dev/input/..., either via (input)lirc or directly reading the device.
The problem is that as well as those events, which I do want, I get X
keyboard events as well, which I don't want. One solution would be to
not use the devinput events after all and reconfigure my application to
recognise the keycodes from the X events, but this means more hassle to
prevent problems like the one with mplayer I detailed above.

ISTR you can put something in xorg.conf to make it grab devices so other
applications can't use them, but I seem to need it to be the other way
round. 

 Maybe you can also change the key events using the input-utils package.

That could be useful. It might cure the shutdown problem as well as the
mplayer one.

-- 
TH * http://www.realh.co.uk
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: I don't want my IR handset to act like a keyboard

2010-01-11 Thread Tony Houghton
On Mon, 11 Jan 2010 16:07:32 -0800
Dan Nicholson dbn.li...@gmail.com wrote:

 On Sun, Jan 10, 2010 at 10:04 AM, Tony Houghton h...@realh.co.uk wrote:

[Trying to stop xorg from seeing my IR controller as a keyboard]

 Xorg is now picking up devices straight from udev and then configuring
 them in xorg.conf{,.d} with InputClass sections. See:
 
 http://who-t.blogspot.com/2010/01/new-configuration-world-order.html
 
 One of the things I'm working on and want to get landed before 1.8 is
 the ability to ignore devices. Something like:
 
 Section InputClass
 Identifier Ignore IR
 MatchProduct Some IR Handset
 Ignore yes
 EndSection
 
 Then Xorg would just skip that device. Would that help?

Yes, that would be excellent.

In the meantime I think the best solution is to use inputlirc with its
-g (grab) option, which starts before X, and support lirc in my
application, boxstar. It felt kind of incomplete without lirc anyway.

-- 
TH * http://www.realh.co.uk
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


I don't want my IR handset to act like a keyboard

2010-01-10 Thread Tony Houghton
I've got a DVB card with an IR controller which appears as an input
device. I want my applications to read the input device directly, not as
a keyboard. Among other reasons, it's because I want to use the OK
button while mplayer is running, but it generates an Enter keypress
which mplayer interprets as please quit.

After trying various things with xorg.conf which always seemed to have
unwanted side effects, I solved the problem by creating
/etc/hal/fdi/policy/20-ir-input.fdi containing:

?xml version=1.0 encoding=ISO-8859-1? !-- -*- SGML -*- --
deviceinfo version=0.2
  device
!-- Stop remote control behaving like a keyboard --
match key=input.product contains=saa7146
  remove key=input.x11_driver /
  remove key=input.xkb.rules /
  remove key=input.xkb.model /
  remove key=input.xkb.layout /
  remove key=input.xkb.variant /
  remove key=info.capabilities type=strlistinput.keys/remove
  remove key=info.capabilities type=strlistbutton/remove
/match
  /device
/deviceinfo

but it isn't doing the trick for X any more. I'm now using xserver-xorg
1:7.5+1 from Debian unstable. I wondered if xorg is no longer using HAL
because it's deprecated, but what should I do instead?

BTW I was also hoping to stop the IR's power button from shutting the
system down, but I had to resort to disabling
/etc/acpi/powerbtn-acpi-support.sh instead, which also prevents the
button on the case from working.

-- 
TH * http://www.realh.co.uk
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg