Ticket #6094: joystick.patch
File joystick.patch, 2.7 KB (added by , 15 years ago) |
---|
-
libs/libmythui/jsmenu.cpp
333 333 */ 334 334 void JoystickMenuThread::ButtonUp(int button) 335 335 { 336 std::vector<buttonMapType>::iterator bmap; 336 std::vector<buttonMapType> bmap = m_map.buttonMap(); 337 std::vector<buttonMapType>::iterator iter; 337 338 338 339 /*------------------------------------------------------------------------ 339 340 ** Process chords first 340 341 **----------------------------------------------------------------------*/ 341 for ( bmap = m_map.buttonMap().begin(); bmap < m_map.buttonMap().end(); bmap++)342 for (iter = bmap.begin(); iter != bmap.end(); iter++) 342 343 { 343 if (button == bmap->button && bmap->chord != -1344 && m_buttons[ bmap->chord] == 1)344 if (button == iter->button && iter->chord != -1 345 && m_buttons[iter->chord] == 1) 345 346 { 346 EmitKey( bmap->keystring);347 m_buttons[ bmap->chord] = 0;347 EmitKey(iter->keystring); 348 m_buttons[iter->chord] = 0; 348 349 return; 349 350 } 350 351 } … … 352 353 /*------------------------------------------------------------------------ 353 354 ** Process everything else 354 355 **----------------------------------------------------------------------*/ 355 for ( bmap = m_map.buttonMap().begin(); bmap < m_map.buttonMap().end(); bmap++)356 for (iter = bmap.begin(); iter != bmap.end(); iter++) 356 357 { 357 if (button == bmap->button && bmap->chord == -1)358 EmitKey( bmap->keystring);358 if (button == iter->button && iter->chord == -1) 359 EmitKey(iter->keystring); 359 360 } 360 361 } 361 362 … … 364 365 */ 365 366 void JoystickMenuThread::AxisChange(int axis, int value) 366 367 { 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++) 369 372 { 370 if (axis == amap->axis)373 if (axis == iter->axis) 371 374 { 372 375 /* If we're currently outside the range, and the move is 373 376 ** 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); 377 380 } 378 381 } 379 382 }