Ticket #6094: joystick.patch

File joystick.patch, 2.7 KB (added by Juha Törnroos <juha.tornroos@…>, 15 years ago)
  • libs/libmythui/jsmenu.cpp

     
    333333 */
    334334void JoystickMenuThread::ButtonUp(int button)
    335335{
    336     std::vector<buttonMapType>::iterator bmap;
     336    std::vector<buttonMapType> bmap = m_map.buttonMap();
     337    std::vector<buttonMapType>::iterator iter;
    337338
    338339    /*------------------------------------------------------------------------
    339340    ** Process chords first
    340341    **----------------------------------------------------------------------*/
    341     for (bmap = m_map.buttonMap().begin(); bmap < m_map.buttonMap().end(); bmap++)
     342    for (iter = bmap.begin(); iter != bmap.end(); iter++)
    342343    {
    343         if (button == bmap->button && bmap->chord != -1
    344             && m_buttons[bmap->chord] == 1)
     344        if (button == iter->button && iter->chord != -1
     345            && m_buttons[iter->chord] == 1)
    345346        {
    346             EmitKey(bmap->keystring);
    347             m_buttons[bmap->chord] = 0;
     347            EmitKey(iter->keystring);
     348            m_buttons[iter->chord] = 0;
    348349            return;
    349350        }
    350351    }
     
    352353    /*------------------------------------------------------------------------
    353354    ** Process everything else
    354355    **----------------------------------------------------------------------*/
    355     for (bmap = m_map.buttonMap().begin(); bmap < m_map.buttonMap().end(); bmap++)
     356    for (iter = bmap.begin(); iter != bmap.end(); iter++)
    356357    {
    357         if (button == bmap->button && bmap->chord == -1)
    358             EmitKey(bmap->keystring);
     358        if (button == iter->button && iter->chord == -1)
     359            EmitKey(iter->keystring);
    359360    }
    360361}
    361362
     
    364365 */
    365366void JoystickMenuThread::AxisChange(int axis, int value)
    366367{
    367     std::vector<axisMapType>::iterator amap;
    368     for (amap = m_map.axisMap().begin(); amap < m_map.axisMap().end(); amap++)
     368    std::vector<axisMapType> amap = m_map.axisMap();
     369    std::vector<axisMapType>::iterator iter;
     370
     371    for (iter = amap.begin(); iter != amap.end(); iter++)
    369372    {
    370         if (axis == amap->axis)
     373        if (axis == iter->axis)
    371374        {
    372375            /* If we're currently outside the range, and the move is
    373376            **   into the range, then we trigger                        */
    374             if (m_axes[axis] < amap->from || m_axes[axis] > amap->to)
    375                 if (value >= amap->from && value <= amap->to)
    376                     EmitKey(amap->keystring);
     377            if (m_axes[axis] < iter->from || m_axes[axis] > iter->to)
     378                if (value >= iter->from && value <= iter->to)
     379                    EmitKey(iter->keystring);
    377380        }
    378381    }
    379382}