[mythtv] Help: intercepting Escape keys

zoiks2004-ivtv at yahoo.com zoiks2004-ivtv at yahoo.com
Tue Jun 28 18:14:37 UTC 2005

In a nutshell: when an Escape key is pressed in a
setup window, the key event (key<> == Qt::Key_Escape)
is sent to the widget with focus, e.g. a MythLineEdit
widget.  When the Escape is generated by lirc, the
widget never gets the key event.  Why?  And, how do I
fix this?

Of course, normally, the MythLineEdit widget will
ignore the escape key and allow a higher level widget
to interpret it.  That's the behavior I'm looking for
for lirc-generated events.

The reason I'm asking is I'm trying to fix the last
major problem with a virtual keyboard widget for the
mythlineedit widget.  If I hit escape from the
keyboard, the mythlineedit properly intercepts the key
event, but not if I do it through the remote.  If I
use the remote, the top level window interprets the
escape event, and exits to a higher menu or to a
previous window screen.  The popup widget I made gets
stuck on the screen if the window goes to a previous
window screen.

In mythmainwindow.cpp, for the method
MythMainWindow::getTarget(QKeyEvent &key), I find the

            // Yes this is special code for handling
            // the escape key.
            if (key.key() == d->escapekey &&
                key_target =

I tried commenting these lines out, but it didn't

Thanks for the help!  Sorry, I'm still new to myth.

More information about the mythtv-dev mailing list