Getting a wireless remote and card-reader to NOT act as a keyboard or mouse

Andrew Barr andrew.james.barr at gmail.com
Wed Aug 2 12:30:16 PDT 2006


On Wed, 2006-08-02 at 14:01 -0500, Kevin Day wrote:
> Is there any way possible to get both of these working on the same
> system, while using and xterminal to not screw up my xterminal,
> inteferce with my keyboard, and make my windowmanager think a mouse is
> sending commands?
> 
> This has been a royal pain to me that these devices are treated as
> keyboards, and for some reason the card-reader has been treated as
> both a mice and a keyboard depending on the distribution (is that an
> xorg.conf problem?)
> 
> 1) The remote control interferes with keyboard buttons that I use for
> things like opening an xterminal, changing the volume, etc..
> 
> 2) As a keyboard, it makes it impossible to type and watch tv at the
> same time and want to change the channel or volume, while still doing
> work. I donot like being forced to do one task at a time.
> 
> 3) As a keyboard, requires me to have the particular object selected
> so that it gets the input. This is not desirable as I put the tv-app
> in the background behind my current windows so i can do work thats
> more important while still being able to see enough of the tv to be
> relevant. Think of how the xbindkeys program works, it doesn't
> actually need to be "selected" to grab the key-input and it does not
> block other apps from receiving all keys.
> 
> 4) As a mouse, it makes my card-reader completely useless as I see the
> mouse move around open a menu and select options, based on the input
> from that card.  WTF!
> 
> These devices should still be able to use the input in the same way
> that they are, but I wish/want them to be treated as seperate devices
> as needed.  To simplify things my problem is comparable to having the
> keyboard and mouse indistinguishable; If I have a terminal open and
> move the mouse, and characters start appearing on the terminal and the
> mouse doesn't move, that is essentially anoher way to put my problem
> with the remotes and card-readers acting as keyboards.
> 
> Is there any possible way to do this, or for this to be done.
> I can see something like "send card-reader events" or "send remote
> events" similar to that of the "send core events" options in the
> xorg.conf files for assing mice and keyboards appropriately.
> 
> And I could care less if the other programs won't support this yet, as
> I can hack'n'patch the support myself. (Being that they are generally
> smaller and less-maintained that Xorg's project)

That is going to be your problem, right there: application support. You
should be able to configure separate mice and keyboards that do not send
core events (e.g. don't move the mouse pointer and send key press
events), but your application has to support selecting it's input from a
certain X input peripheral (look at the GIMP for an example of an app
that can do this, it's done with e.g. Wacom tablets).

With the mouse driver, you should be able to specify in the input device
file. Your default is probably '/dev/input/mice' which multiplexes all
mice events into one file. If I'm not mistaken this hack was invented
for the X server in the first place. You need to figure out which mouse
device is your real mouse and which is your card reader (or remote),
probably also crafting udev rules to get consistent and predictable
naming, and specify those device files in xorg.conf as separate
"InputDevice" sections.

For the keyboard, I think it's a little different. You probably need to
use a keyboard driver other than the default. There is an evdev driver,
this I think is what you want. I don't think the default keyboard driver
allows you to specify the input device file. I was under the impression
that there was also a "new" keyboard driver, perhaps someone can be more
specific on this.

And then in "ServerLayout", you want to specify these input devices but
only your real mouse and keyboard as "CoreMouse" and "CoreKeyboard",
respectively. Then your application needs XInput support and it should
have a mechanism for you to choose the input device you want to use.
There might be wrappers that use LD_PRELOAD or something that can help
you hack around missing application support.

Finally, why not try LIRC for your remote? IIRC it has support for
remotes that present themselves as USB HID keyboards, and lots of
multimedia applications support LIRC input, whereas Xinput support is
probably a lot less common.

HTH,
Andrew



More information about the xorg mailing list