[mythtv] LIRC question

Micah F. Galizia mfgalizi at uwo.ca
Mon Oct 31 10:50:22 EST 2005

Hash: SHA1

Daniel Kristjansson wrote:
> On Sun, 2005-10-30 at 21:11 -0500, Hal Burch wrote:
>>The remote control system seems a bit hackish, translating remote
>>events to keypress events.  Is this a conscience design, a result of
>>the recent addition of native LIRC support, or the result of the Lirc
> Not really a conscious design AFAIC, but there has been at least one
> failed attempt to change this. The failed attempt didn't keep in mind
> that MythTV is a cross-platform application and tied keyboard input
> too tightly with Linux.

Yeah, that was me, and it didn't work at all.  Its not so much conscious
design decision, rather, a side effect of the way Qt and myth handle
input events.  The basic flow of keyboard input is from the device,
through the kernel, to X (or the Qt input driver if your using Qt
embedded) and then finally, Qt grabs the event, turns it into it's own
event (QKeyEvent) and passes it off to the application.

If you use lirc, the path is slightly different.  The end result is the
generation of a QCustomEvent based on the LIRC event.

> If you want to work on the LIRC code, may I suggest that a better way
> to setup MythTV for the user's particular remote may be a better first
> step? Perhaps have the user choose a picture of a remote best matching
> theirs and then highlighting each key in the image of the remote and
> have the user press that button, then you could have some defaults
> for each button that the user could change by cursoring to the button
> on the on screen picture of a remote, selecting the button, and
> choosing a function from a combo box.

That kind of simplicity would be spectacular.

> Right now you need to program LIRC with the buttons on your remote 
> with a text file and a command line utility, then map each button
> to a key that corresponds to some function in MythTV with another
> text file, and only then do you run into the problem that remapping
> keys to different functions means that you must fix-up that second
> text file...

The next X release (I think) will come with an evdev input device
driver, which will work with the Linux input system directly.  The input
system can handle all remote controls (without lirc) and correctly map
your buttons to the appropriate symbolic events.

The problem at that point is with X and Qt.  X needs to generate an
appropriate event for the key, and then Qt needs to generate a
meaningful event, instead of Key_unknown.  For basic multimedia keys
(play, pause, etc) this should work, but some of the less common keys,
like the "subtitles" key, have no representation in X or Qt.

You may be asking yourself what this has to do with the original
question.  Basically, what I'm saying is that in the (hopefully near)
future, you wont need to configure lirc or your remote control.  You can
just plug it in, and tell mythweb or mythcontrols what each key should
do.  That said, it wont be a reality until X and Qt have appropriately
mapped keys from the kernel's input system.

Until then, I think your stuck with xmodmap or lirc.
- --
Micah Galizia
mfgalizi at uwo.ca

"The mark of an immature man is that he wants to die nobly for a cause,
while the mark of the mature man is that he wants to live humbly for
one."   --W. Stekel
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org


More information about the mythtv-dev mailing list