本文整理汇总了C++中JoyDPad::getJoyButtons方法的典型用法代码示例。如果您正苦于以下问题:C++ JoyDPad::getJoyButtons方法的具体用法?C++ JoyDPad::getJoyButtons怎么用?C++ JoyDPad::getJoyButtons使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JoyDPad
的用法示例。
在下文中一共展示了JoyDPad::getJoyButtons方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setActiveSetNumber
//.........这里部分代码省略.........
}
else if (!button->getWhileHeldStatus())
{
// Ensure that set change events are performed if needed.
tempignore = false;
}
}
else
{
// Ensure that set change events are performed if needed.
button->setWhileHeldStatus(false);
//tempignore = false;
}
}
button->joyEvent(value, tempignore);
}
// Activate all axis buttons in the switched set
for (int i = 0; i < current_set->getNumberAxes(); i++)
{
int value = axesstates.at(i);
bool tempignore = true;
JoyAxis *axis = current_set->getJoyAxis(i);
JoyAxisButton *oldButton = old_set->getJoyAxis(i)->getAxisButtonByValue(value);
JoyAxisButton *button = axis->getAxisButtonByValue(value);
if (button && oldButton)
{
if (button->getChangeSetCondition() == JoyButton::SetChangeWhileHeld)
{
if (oldButton->getChangeSetCondition() == JoyButton::SetChangeWhileHeld && oldButton->getWhileHeldStatus())
{
// Button from old set involved in a while held set
// change. Carry over to new set button to ensure
// set changes are done in the proper order.
button->setWhileHeldStatus(true);
}
else if (!button->getWhileHeldStatus())
{
// Ensure that set change events are performed if needed.
tempignore = false;
}
}
}
else if (!button)
{
// Ensure that set change events are performed if needed.
axis->getPAxisButton()->setWhileHeldStatus(false);
axis->getNAxisButton()->setWhileHeldStatus(false);
}
axis->joyEvent(value, tempignore);
}
// Activate all dpad buttons in the switched set
for (int i = 0; i < current_set->getNumberHats(); i++)
{
int value = dpadstates.at(i);
bool tempignore = true;
JoyDPad *dpad = current_set->getJoyDPad(i);
JoyDPadButton *button = dpad->getJoyButton(value);
JoyDPadButton *oldButton = old_set->getJoyDPad(i)->getJoyButton(value);
if (button && oldButton)
{
if (button->getChangeSetCondition() == JoyButton::SetChangeWhileHeld)
{
if (value)
{
if (oldButton->getChangeSetCondition() == JoyButton::SetChangeWhileHeld && oldButton->getWhileHeldStatus())
{
// Button from old set involved in a while held set
// change. Carry over to new set button to ensure
// set changes are done in the proper order.
button->setWhileHeldStatus(true);
}
else if (!button->getWhileHeldStatus())
{
// Ensure that set change events are performed if needed.
tempignore = false;
}
}
}
}
else if (!button)
{
QHashIterator<int, JoyDPadButton*> iter(*dpad->getJoyButtons());
while (iter.hasNext())
{
// Ensure that set change events are performed if needed.
JoyDPadButton *button = iter.next().value();
button->setWhileHeldStatus(false);
}
}
dpad->joyEvent(value, tempignore);
}
}
}