Ticket #2239: mythtv-lirc-20060824.diff

File mythtv-lirc-20060824.diff, 22.8 KB (added by anonymous, 19 years ago)
  • libs/libmythtv/tv_play.cpp

     
    3939#include "DVDRingBuffer.h"
    4040#include "datadirect.h"
    4141#include "sourceutil.h"
     42#include "mythkeysequence.h"
    4243
    4344#ifndef HAVE_ROUND
    4445#define round(x) ((int) ((x) + 0.5))
     
    608609            {
    609610                query.next();
    610611
    611                 QKeySequence keyseq(query.value(0).toString());
     612                MythKeySequence keyseq(query.value(0).toString());
    612613
    613                 int keynum = keyseq[0];
     614                int keynum = keyseq[0]->value();
    614615                keynum &= ~Qt::UNICODE_ACCEL;
    615616   
    616617                keyList.prepend(new QKeyEvent(QEvent::KeyPress, keynum, 0, 0));
  • libs/libmythui/mythmainwindow.cpp

     
    4040#include "mythcontext.h"
    4141#include "mythdbcon.h"
    4242#include "mythgesture.h"
     43#include "mythkeysequence.h"
    4344
    4445/* from libmyth */
    4546#include "screensaver.h"
     
    9596class KeyContext
    9697{
    9798  public:
    98     void AddMapping(int key, QString action)
     99    void AddMapping(QString key, QString action)
    99100    {
    100101        actionMap[key].append(action);
    101102    }
     103    void AddMapping(int key, QString action)
     104    {
     105        QString keystr;
     106        keystr.setNum(key);
     107        actionMap[keystr].append(action);
     108    }
    102109
    103     bool GetMapping(int key, QStringList &actions)
     110    bool GetMapping(QString key, QStringList &actions)
    104111    {
    105112        if (actionMap.count(key) > 0)
    106113        {
     
    109116        }
    110117        return false;
    111118    }
     119    bool GetMapping(int key, QStringList &actions)
     120    {
     121        QString keystr;
     122        keystr.setNum(key);
     123        return GetMapping(keystr, actions);
     124    }
    112125
    113     QMap<int, QStringList> actionMap;
     126    //QMap<int, QStringList> actionMap;
     127    QMap<QString, QStringList> actionMap;
    114128};
    115129
    116130struct JumpData
     
    153167    bool popwindows;
    154168
    155169    QDict<KeyContext> keyContexts;
    156     QMap<int, JumpData*> jumpMap;
     170    //QMap<int, JumpData*> jumpMap;
     171    QMap<QString, JumpData*> jumpMap;
    157172    QMap<QString, JumpData> destinationMap;
    158173    QMap<QString, MHData> mediaHandlerMap;
    159174    QMap<QString, MPData> mediaPluginMap;
     
    649664                                               0, Qt::NoButton);
    650665                QObject *key_target = getTarget(*key);
    651666                QApplication::postEvent(key_target, key);
     667                return;
    652668            }
    653669            return;
    654670        }
     
    672688                QKeyEvent *key = new QKeyEvent(QEvent::KeyPress, d->escapekey,
    673689                                               0, Qt::NoButton);
    674690                QApplication::postEvent(this, key);
     691                return;
    675692            }
    676693            return;
    677694        }
     
    705722{
    706723    actions.clear();
    707724    int keynum = d->TranslateKeyNum(e);
     725    bool retval = false;
    708726
     727    QString keystr;
     728    keystr.setNum( keynum );
     729
     730#ifdef USE_LIRC
     731    /* If there's LIRC support, we must check for those here -- check the
     732     * remoteXXXXX identifiers;
     733     */
     734    if ((e->ascii( ) == 0) && (e->key( ) == 0) && (e->text( ).left(6) == "remote"))
     735    {
     736        VERBOSE(VB_GENERAL, QString("MythMainWindow::TranslateKeyPress() - Remote button '%1' received in context '%2'.")
     737                                              .arg(e->text( )).arg(context.latin1()) );
     738
     739        if (allowJumps &&
     740            d->jumpMap.count(e->text()) > 0 && d->exitmenucallback == NULL)
     741        {
     742            d->exitingtomain = true;
     743            d->exitmenucallback = d->jumpMap[ e->text() ]->callback;
     744            QApplication::postEvent(this, new ExitToMainMenuEvent());
     745            return false;
     746        }
     747
     748
     749        if ((d->keyContexts[context]) &&
     750            (d->keyContexts[context]->GetMapping( e->text(), actions)))
     751        {
     752            retval = true;
     753        }
     754
     755
     756        if ((context != "Global") &&
     757            (d->keyContexts["Global"]->GetMapping( e->text(), actions )))
     758        {
     759            retval = true;
     760        }
     761
     762        return retval;
     763    }
     764
     765#endif // USE_LIRC
     766
    709767    if (allowJumps &&
    710         d->jumpMap.count(keynum) > 0 && d->exitmenucallback == NULL)
     768        d->jumpMap.count(keystr) > 0 && d->exitmenucallback == NULL)
    711769    {
    712770        d->exitingtomain = true;
    713         d->exitmenucallback = d->jumpMap[keynum]->callback;
     771        d->exitmenucallback = d->jumpMap[keystr]->callback;
    714772        QApplication::postEvent(this, new ExitToMainMenuEvent());
    715773        return false;
    716774    }
    717775
    718     bool retval = false;
    719776
    720777    if (d->keyContexts[context])
    721778    {
    722         if (d->keyContexts[context]->GetMapping(keynum, actions))
     779        if (d->keyContexts[context]->GetMapping(keystr, actions))
    723780            retval = true;
    724781    }
    725782
    726783    if (context != "Global" &&
    727         d->keyContexts["Global"]->GetMapping(keynum, actions))
     784        d->keyContexts["Global"]->GetMapping(keystr, actions))
    728785    {
    729786        retval = true;
    730787    }
     
    737794    KeyContext * keycontext = d->keyContexts[context];
    738795    if (keycontext == NULL) return;
    739796
    740     QMap<int,QStringList>::Iterator it;
     797    //QMap<int,QStringList>::Iterator it;
     798    QMap<QString,QStringList>::Iterator it;
    741799    for (it = keycontext->actionMap.begin();
    742800         it != keycontext->actionMap.end();
    743801         it++)
     
    763821void MythMainWindow::BindKey(const QString &context, const QString &action,
    764822                             const QString &key)
    765823{
    766     QKeySequence keyseq(key);
     824    MythKeySequence keyseq(key);
    767825
    768826    if (!d->keyContexts[context])
    769827        d->keyContexts.insert(context, new KeyContext());
    770828
    771829    for (unsigned int i = 0; i < keyseq.count(); i++)
    772830    {
    773         int keynum = keyseq[i];
     831        int keynum = keyseq[i]->value();
    774832        keynum &= ~Qt::UNICODE_ACCEL;
     833        QString keystr;
     834#ifdef USE_LIRC
     835        if(keyseq[i]->isRemote()) keystr = keyseq[i]->text();
     836        else  // intensional
     837#endif // USE_LIRC
     838        keystr.setNum( keynum );
    775839
    776840        QStringList dummyaction = "";
    777         if (d->keyContexts[context]->GetMapping(keynum, dummyaction))
     841        if (d->keyContexts[context]->GetMapping(keystr, dummyaction))
    778842        {
    779843            VERBOSE(VB_GENERAL, QString("Key %1 is bound to multiple actions "
    780844                                        "in context %2.")
    781845                    .arg(key).arg(context));
    782846        }
    783847
    784         d->keyContexts[context]->AddMapping(keynum, action);
     848        d->keyContexts[context]->AddMapping(keystr, action);
    785849        //VERBOSE(VB_GENERAL, QString("Binding: %1 to action: %2 (%3)")
    786850        //                           .arg(key).arg(action)
    787851        //                           .arg(context));
     
    868932       return;
    869933    }
    870934
    871     QMap<int, JumpData*>::Iterator it;
     935    // QMap<int, JumpData*>::Iterator it;
     936    QMap<QString, JumpData*>::Iterator it;
    872937    for (it = d->jumpMap.begin(); it != d->jumpMap.end(); ++it)
    873938    {
    874939
     
    888953       return;
    889954    }
    890955
    891     QKeySequence keyseq(key);
     956    MythKeySequence keyseq(key);
    892957
    893958    for (unsigned int i = 0; i < keyseq.count(); i++)
    894959    {
    895         int keynum = keyseq[i];
     960        int keynum = keyseq[i]->value();
    896961        keynum &= ~Qt::UNICODE_ACCEL;
     962        QString keystr;
     963#ifdef USE_LIRC
     964        if (keyseq[i]->isRemote()) keystr = keyseq[i]->text();
     965        else // intensional
     966#endif
     967        keystr.setNum( keynum );
    897968
    898         if (d->jumpMap.count(keynum) == 0)
     969        if (d->jumpMap.count( keystr ) == 0)
    899970        {
    900971            //VERBOSE(VB_GENERAL, QString("Binding: %1 to JumpPoint: %2")
    901972            //                           .arg(keybind).arg(destination));
    902 
    903             d->jumpMap[keynum] = &d->destinationMap[destination];
     973   
     974            d->jumpMap[ keystr ] = &d->destinationMap[destination];
    904975        }
    905976        else
    906977        {
    907             VERBOSE(VB_GENERAL, QString("Key %1 is already bound to a jump "
    908                                         "point.").arg(key));
     978            VERBOSE(VB_GENERAL, QString("%1 is already bound to a jump "
     979                                        "point.").arg(keystr));
    909980        }
     981        //else
     982        //    VERBOSE(VB_GENERAL, QString("JumpPoint: %2 exists, no keybinding")
     983        //                               .arg(destination));
    910984    }
    911     //else
    912     //    VERBOSE(VB_GENERAL, QString("JumpPoint: %2 exists, no keybinding")
    913     //                               .arg(destination));
    914 
    915985}
    916986
    917987void MythMainWindow::RegisterJump(const QString &destination,
     
    12591329        LircKeycodeEvent *lke = (LircKeycodeEvent *)ce;
    12601330        int keycode = lke->getKeycode();
    12611331
    1262         if (keycode)
     1332        if (lke->getLircText().left(6) == "remote")
    12631333        {
     1334            /* Attempt to send this to the application;
     1335             */
     1336             VERBOSE(VB_GENERAL, QString("MythMainWindow::customEvent() - Sending '%1' to keypress-handler.")
     1337                                                .arg(lke->getLircText()) );
     1338 
     1339            /* Send a press & release -- abusing the Unicode field for
     1340             * passing the LIRC logical identifier.
     1341             */
     1342            QKeyEvent keyp( QEvent::KeyPress, 0, 0, 0, lke->getLircText( ) );
     1343            QKeyEvent keyr( QEvent::KeyRelease, 0, 0, 0, lke->getLircText( ) );
     1344 
     1345            QObject *key_target = getTarget(keyp);
     1346       
     1347            if (!key_target)
     1348            {
     1349                QApplication::sendEvent( this, &keyp );
     1350                QApplication::sendEvent( this, &keyr );
     1351            }
     1352            else
     1353            {
     1354                QApplication::sendEvent( key_target, &keyp );
     1355                QApplication::sendEvent( key_target, &keyr );
     1356            }
     1357        }
     1358        else if (keycode)
     1359        {
    12641360            gContext->ResetScreensaver();
    12651361            if (gContext->GetScreenIsAsleep())
    12661362                return;
  • libs/libmyth/lirc.cpp

     
    1515#include "lirc.h"
    1616#include "lircevent.h"
    1717#include "util.h"
     18#include "mythkeysequence.h"
    1819
    1920#if (QT_VERSION < 0x030100)
    2021#error Native LIRC support requires Qt 3.1 or greater.
     
    7273        while ((ret = lirc_code2char(lircConfig, ir, &code)) == 0 &&
    7374               code != NULL)
    7475        {
    75             QKeySequence a(code);
     76            MythKeySequence a(code);
    7677
    7778            int keycode = 0;
    7879
     
    8586
    8687            for (unsigned int i = 0; i < a.count(); i++)
    8788            {
    88                 keycode = a[i];
    89 
    90                 QApplication::postEvent(mainWindow, new LircKeycodeEvent(code,
     89                if (a[i]->isRemote()) // is really bound to a remoteXXX
     90                {
     91                    QApplication::postEvent(mainWindow, new LircKeycodeEvent( a[i]->text().latin1(), 0, true  ));
     92                }
     93                else
     94                {
     95                    keycode = a[i]->value( );
     96                    QApplication::postEvent(mainWindow, new LircKeycodeEvent(code,
    9197                                        keycode, true));
    92                 QApplication::postEvent(mainWindow, new LircKeycodeEvent(code,
     98                    QApplication::postEvent(mainWindow, new LircKeycodeEvent(code,
    9399                                        keycode, false));
    94100
     101                }
     102
    95103                SpawnApp();
    96104            }
    97105        }
  • libs/libmyth/jsmenu.cpp

     
    3232#include <fcntl.h>
    3333
    3434#include "mythcontext.h"
     35#include "mythkeysequence.h"
    3536
    3637#include <iostream>
    3738using namespace std;
     
    292293**--------------------------------------------------------------------------*/
    293294void JoystickMenuClient::EmitKey(QString code)
    294295{
    295     QKeySequence a(code);
     296    MythKeySequence a(code);
    296297
    297298    int keycode = 0;
    298299
     
    305306
    306307    for (unsigned int i = 0; i < a.count(); i++)
    307308    {
    308         keycode = a[i];
     309        keycode = a[i]->value();
    309310
    310311        QApplication::postEvent(mainWindow, new JoystickKeycodeEvent(code,
    311312                                keycode, true));
  • libs/libmyth/libmyth.pro

     
    1919HEADERS += dbsettings.h screensaver-null.h output.h visual.h
    2020HEADERS += langsettings.h audiooutputnull.h mythsocket.h
    2121HEADERS += DisplayResScreen.h util-x11.h mythdeque.h qmdcodec.h
    22 HEADERS += exitcodes.h virtualkeyboard.h mythobservable.h mythevent.h
     22HEADERS += exitcodes.h virtualkeyboard.h mythobservable.h mythevent.h mythkeysequence.h
    2323
    2424SOURCES += dialogbox.cpp lcddevice.cpp mythcontext.cpp mythwidgets.cpp
    2525SOURCES += oldsettings.cpp remotefile.cpp settings.cpp
     
    3131SOURCES += dbsettings.cpp screensaver.cpp screensaver-null.cpp output.cpp
    3232SOURCES += langsettings.cpp mythdbcon.cpp audiooutputnull.cpp
    3333SOURCES += DisplayResScreen.cpp util-x11.cpp qmdcodec.cpp
    34 SOURCES += virtualkeyboard.cpp mythobservable.cpp mythsocket.cpp
     34SOURCES += virtualkeyboard.cpp mythobservable.cpp mythsocket.cpp mythkeysequence.cpp
    3535
    3636INCLUDEPATH += ../libmythsamplerate ../libmythsoundtouch ../.. ../
    3737DEPENDPATH += ../libmythsamplerate ../libmythsoundtouch ../ ../libmythui
  • libs/libmyth/mythkeysequence.h

     
     1/*
     2 * File:    mythkeysequence.h
     3 *
     4 * Purpose: This implements the MythKeySequence class. QKeySequence cannot
     5 *          be easily extended not to ignore 'remoteXXX' identifiers.
     6 *
     7 *          This replacement class fixes that and removes the need for
     8 *          some duplicate code in MythTV and the MythControls-plugin.
     9 *
     10 * History:
     11 *
     12 * 20060620
     13 *   - Renamed member routine 'keyNum()' to 'value()'.
     14 *   - Bugfixed problem with 'F1,M,{,<' only assigning 3 keys.
     15 *   - Max.length of sequence configurable through #define MYTHKEY_SEQLEN.
     16 */
     17
     18#ifndef _KEYSEQ_H_
     19#define _KEYSEQ_H_
     20
     21#include <qobject.h>
     22#include <qkeysequence.h>
     23
     24/* The #define's below define internal features;
     25 ***********************************************/
     26
     27// Maximum length of KeySequence -- default same as QKeySequence:
     28#ifndef MYTHKEY_SEQLEN
     29
     30    #define     MYTHKEY_SEQLEN                          4
     31#else
     32
     33    #warning    MYTHKEY_SEQLEN is already defined -- skipping assignment.
     34#endif
     35
     36
     37/******************** MythKeySequence / MythKey classes **********************/
     38class MythKeySequence;
     39
     40class MythKey : public QObject
     41{
     42    Q_OBJECT
     43
     44    public:
     45        MythKey( );
     46        MythKey( const int );
     47        MythKey( const QString );
     48
     49        /* Assign the key */
     50        bool    setKey( const int );
     51        bool    setKey( const QString );
     52        void    clear( );
     53
     54        /* Text representation, ie. Ctrl+PgUp, or remoteGUIDE */
     55        QString text( );
     56        /* Numeric value, only valid if Keys */
     57        int     value( );
     58        /* More query stuff */
     59        bool    isRemote( );
     60        bool    isAssigned( );
     61
     62        operator int();
     63
     64    private:
     65        bool    key_assigned;   /* .. */
     66        int     is_button;      /* Key is a button, i.e. not coming from a keyboard */
     67
     68        int     key_num;        /* Integer representation of key (is 0 for remote buttons) */
     69        QString key_str;        /* Text representation of key / button */
     70
     71    friend class MythKeySequence;
     72};
     73
     74class MythKeySequence : public QObject
     75{
     76    Q_OBJECT
     77
     78    public:
     79        MythKeySequence( );
     80        MythKeySequence( int k1, int k2=0, int k3=0, int k4=0 );
     81        MythKeySequence( const QString & );
     82
     83        /* Assign multiple keys */
     84        uint        setKeys( const QString & );
     85
     86        /* Query stuff */
     87        bool        isEmpty( );
     88        void        clear( );
     89        uint        count( );
     90
     91        MythKey*    operator[]( int index );
     92        bool        operator ==( const MythKeySequence & );
     93        operator    QString( );
     94
     95        MythKey     keys[ MYTHKEY_SEQLEN ];
     96
     97    private:
     98        uint        keys_assigned;
     99};
     100
     101#endif // _KEYSEQ_H_
  • libs/libmyth/mythkeysequence.cpp

     
     1/*
     2 * File:    mythkeysequence.cpp
     3 *
     4 * Purpose: See mythkeysequence.h
     5 */
     6#include <mythkeysequence.h>
     7
     8/*** MythKey ***
     9 ***************/
     10MythKey::MythKey( )
     11{
     12    this->clear( );
     13}
     14
     15MythKey::MythKey( const int key )
     16{
     17    if (!(this->setKey( key )))
     18        this->clear( );
     19}
     20
     21MythKey::MythKey( const QString key )
     22{
     23    if (!(this->setKey( key )))
     24        this->clear( );
     25}
     26
     27/* MythKey member routines */
     28void MythKey::clear( )
     29{
     30    this->key_assigned = false;
     31    this->key_str = "";
     32    this->key_num = 0;
     33}
     34
     35bool MythKey::setKey( const int key )
     36{
     37    bool retval = false;
     38
     39    // Passed by key-num are keys, no buttons
     40    this->is_button = 0;
     41    QKeySequence keyseq( key );
     42    if (keyseq.count( ) > 0)
     43    {
     44        retval = true;
     45        this->key_num = keyseq[ 0 ];
     46        this->key_str = QString(keyseq);
     47    }
     48    this->key_assigned = retval;
     49    return retval;
     50}
     51
     52bool MythKey::isRemote( )
     53{
     54    return this->is_button;
     55}
     56
     57bool MythKey::isAssigned( )
     58{
     59    return this->key_assigned;
     60}
     61
     62bool MythKey::setKey( const QString key )
     63{
     64    this->key_assigned = false;
     65    bool retval = false;
     66    if (key.left( 6 ).lower( ) == "remote")
     67    {
     68        retval = true;
     69        this->is_button = 1;
     70
     71        /* Use this value as-is, no checking at all */
     72        this->key_str = key;
     73        this->key_num = 0;
     74    }
     75    else
     76    {
     77        this->is_button = 0;
     78
     79        /* Use the QKeySequence to check this key's validity and to set
     80         * appropriate fields. We pass ',,' to make the QKeySequence
     81         * see the ',' because it'll fail on a *single* ','  */
     82        QString keystr = key.stripWhiteSpace( );
     83        QKeySequence keyseq( (keystr == ","?",,":keystr) );
     84        if (keyseq[ 0 ])
     85        {
     86            retval = true;
     87            this->key_num = keyseq[ 0 ];
     88            this->key_str = key.stripWhiteSpace( );
     89        }
     90//        else printf( "no keyseq\n" );
     91    }
     92
     93    this->key_assigned = retval;
     94    return retval;
     95}
     96
     97
     98QString MythKey::text( )
     99{
     100    if (this->key_assigned)
     101    {
     102        if (this->key_str.length() == 0)
     103        {
     104            QString key;
     105            key.setNum( this->key_num );
     106            return key;
     107        }
     108            else return this->key_str;
     109    }
     110
     111    return "";
     112}
     113
     114int MythKey::value( )
     115{
     116    if (this->key_assigned)
     117        return this->key_num;
     118    else
     119        return 0;
     120}
     121
     122MythKey::operator int( )
     123{
     124    return this->value( );
     125}
     126
     127
     128/*** MythKeySequence ***
     129 ***********************/
     130MythKeySequence::MythKeySequence( )
     131{
     132    this->clear( );
     133}
     134
     135MythKeySequence::MythKeySequence( int k1, int k2, int k3, int k4 )
     136{
     137    uint k_index = 0;
     138
     139    if (k1 > 0) this->keys[ ++k_index ].setKey( k1 );
     140    if (k2 > 0) this->keys[ ++k_index ].setKey( k2 );
     141    if (k3 > 0) this->keys[ ++k_index ].setKey( k3 );
     142    if (k4 > 0) this->keys[ ++k_index ].setKey( k4 );
     143}
     144
     145MythKeySequence::MythKeySequence( const QString &keys )
     146{
     147    this->setKeys( keys );
     148}
     149
     150
     151/* MythKeySequence member routines */
     152uint MythKeySequence::setKeys( const QString &keys )
     153{
     154    unsigned int  token_start = 0, k_index = 0, new_start;
     155    unsigned int  i, max=keys.length();
     156    unsigned char c_last = 0;
     157    bool          fc = (keys[ 0 ] == ","), lc = false;
     158    int           commas = (fc?1:0);
     159    int           do_comma, do_token;
     160    //
     161    for (i=1; i< max; i++)
     162    {
     163        do_comma=do_token=0;
     164        if (keys[i] == ",")
     165        {
     166            /* Got a comma -- if this is the first one there
     167             * could be a token before it. */
     168            if ((!lc) && (i>1)) do_token=1;
     169            else token_start = i + 1;
     170
     171            lc=true;
     172            commas++;
     173
     174            /* If we reached the end here at 2 comma's, we
     175             * should register one. */
     176            if ((commas == 2) && (i == max - 1))
     177            {
     178                do_comma = 1;
     179                new_start = i;
     180            }
     181        }
     182        else
     183        {
     184            /* No comma -- still in a token.
     185             */
     186            if (commas == 0)
     187            {
     188                if (i==max-1)
     189                {
     190                    i = max;
     191                    do_token=1;
     192
     193                    new_start = i + 1;
     194                }
     195            }
     196            else if ((commas == 2) && (fc))
     197            {
     198                do_comma = 1;
     199                new_start = i;
     200            }
     201            else if ((commas == 2) && (i == max - 1))
     202            {
     203                do_comma = 1;
     204                new_start = i;
     205            }
     206            else if (commas == 3)
     207            {
     208                if (i < max - 1)
     209                {
     210                    do_comma = 1;
     211                    new_start = i;
     212                }
     213            }
     214
     215            fc=lc=false;
     216            commas = 0;
     217        }
     218
     219        if (do_token || do_comma)
     220        {
     221            if (k_index < MYTHKEY_SEQLEN)
     222            {
     223                if (this->keys[ k_index ].setKey( do_comma?",":keys.mid( token_start, i - token_start ) ))
     224                    k_index++;
     225            }
     226
     227            token_start = i + do_token; //new_start;
     228        }
     229
     230    } // for(..
     231
     232    if (max == 1)
     233    {
     234        this->keys[ k_index++ ].setKey( keys.stripWhiteSpace() );
     235    }
     236    else if ( (c_last != ',') && (c_last != keys.mid( token_start )) && (k_index < MYTHKEY_SEQLEN) )
     237    {
     238        this->keys[ k_index++ ].setKey( keys.mid( token_start ) );
     239    }
     240
     241    this->keys_assigned = k_index;
     242    return k_index;
     243}
     244
     245uint MythKeySequence::count( )
     246{
     247    return this->keys_assigned;
     248}
     249
     250void MythKeySequence::clear( )
     251{
     252    this->keys_assigned = 0;
     253
     254    for(int i=0; i<MYTHKEY_SEQLEN; i++)
     255        this->keys[ i ].clear( );
     256}
     257
     258
     259MythKey* MythKeySequence::operator[]( int index )
     260{
     261    if( (index >= 0) && (index < MYTHKEY_SEQLEN) )
     262        return &(this->keys[ index ]);
     263    return 0;
     264}
     265
     266MythKeySequence::operator QString( )
     267{
     268    QString retval = "";
     269    for (uint i=0; i<MYTHKEY_SEQLEN; i++)
     270    {
     271        if (this->keys[i].key_assigned)
     272        {
     273            if (retval != "") retval += ", ";
     274                retval += this->keys[i].text( );
     275        }
     276    }
     277    return retval;
     278}