[mythtv] "global" keys?

Renchi Raju renchi at pooh.tam.uiuc.edu
Wed Sep 24 12:35:41 EDT 2003


On Wed, 24 Sep 2003, thor wrote:

> On Wednesday 24 September 2003 10:48 am, henri at qais.com wrote:
> >
> > also would like to try a few other "global" keys.
> >
> > looking at the source i wasn't too sure what the cleanest
> > way to do that would be...
>
> 	Not easy. You could .... make every module return exit codes
> (signalling what the user wanted to do next), and then rewrite all of
> them to accept certain global keypresses, shut themselves down and
> spit out the right exit codes.
>
> - thor

an easy way is to install a global eventfilter in all modules (fairly easy
with QObject::installEventFilter) and then let this handle the keypresses and
ignore any that it can't understand. For this to be done, make a class
derived from qobject which installs the eventfilter. All myth modules can
inherit from this class instead of qobject directly.

renchi


More information about the mythtv-dev mailing list