[mythtv] Help: intercepting Escape keys

zoiks2004-ivtv at yahoo.com zoiks2004-ivtv at yahoo.com
Wed Jun 29 03:12:27 UTC 2005


I have solved this.  Thanks to Micah Galizia.  The
thing to do is use grabKeyboard() and
releaseKeyboard() to force input to go to the new
widget.  Interestingly, commenting out the part in
getTarget() referring to the escape key has no effect.
 Still don't fully understand the details of this but
what the hey it works.


--- zoiks2004-ivtv at yahoo.com wrote:

> 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
> lines
> 
>             // Yes this is special code for handling
> the
>             // the escape key.
>             if (key.key() == d->escapekey &&
> focus_widget->topLevelWidget())
>                 key_target =
> focus_widget->topLevelWidget();
> 
> 
> I tried commenting these lines out, but it didn't
> help.
> 
> Thanks for the help!  Sorry, I'm still new to myth.
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev at mythtv.org
>
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
> 



More information about the mythtv-dev mailing list