本文整理汇总了C++中JoyDPad::getRealJoyNumber方法的典型用法代码示例。如果您正苦于以下问题:C++ JoyDPad::getRealJoyNumber方法的具体用法?C++ JoyDPad::getRealJoyNumber怎么用?C++ JoyDPad::getRealJoyNumber使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JoyDPad
的用法示例。
在下文中一共展示了JoyDPad::getRealJoyNumber方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: writeConfig
void InputDevice::writeConfig(QXmlStreamWriter *xml)
{
xml->writeStartElement(getXmlName());
xml->writeAttribute("configversion", QString::number(PadderCommon::LATESTCONFIGFILEVERSION));
xml->writeAttribute("appversion", PadderCommon::programVersion);
xml->writeComment("The SDL name for a joystick is included for informational purposes only.");
xml->writeTextElement("sdlname", getSDLName());
for (int i=0; i < getNumberSticks(); i++)
{
JoyControlStick *stick = getActiveSetJoystick()->getJoyStick(i);
xml->writeStartElement("stickAxisAssociation");
xml->writeAttribute("index", QString::number(stick->getRealJoyIndex()));
xml->writeAttribute("xAxis", QString::number(stick->getAxisX()->getRealJoyIndex()));
xml->writeAttribute("yAxis", QString::number(stick->getAxisY()->getRealJoyIndex()));
xml->writeEndElement();
}
for (int i=0; i < getNumberVDPads(); i++)
{
VDPad *vdpad = getActiveSetJoystick()->getVDPad(i);
xml->writeStartElement("vdpadButtonAssociations");
xml->writeAttribute("index", QString::number(vdpad->getRealJoyNumber()));
JoyButton *button = vdpad->getVButton(JoyDPadButton::DpadUp);
if (button)
{
xml->writeStartElement("vdpadButtonAssociation");
if (typeid(*button) == typeid(JoyAxisButton))
{
JoyAxisButton *axisbutton = static_cast<JoyAxisButton*>(button);
xml->writeAttribute("axis", QString::number(axisbutton->getAxis()->getRealJoyIndex()));
xml->writeAttribute("button", QString::number(button->getJoyNumber()));
}
else
{
xml->writeAttribute("axis", QString::number(0));
xml->writeAttribute("button", QString::number(button->getRealJoyNumber()));
}
xml->writeAttribute("direction", QString::number(JoyDPadButton::DpadUp));
xml->writeEndElement();
}
button = vdpad->getVButton(JoyDPadButton::DpadDown);
if (button)
{
xml->writeStartElement("vdpadButtonAssociation");
if (typeid(*button) == typeid(JoyAxisButton))
{
JoyAxisButton *axisbutton = static_cast<JoyAxisButton*>(button);
xml->writeAttribute("axis", QString::number(axisbutton->getAxis()->getRealJoyIndex()));
xml->writeAttribute("button", QString::number(button->getJoyNumber()));
}
else
{
xml->writeAttribute("axis", QString::number(0));
xml->writeAttribute("button", QString::number(button->getRealJoyNumber()));
}
xml->writeAttribute("direction", QString::number(JoyDPadButton::DpadDown));
xml->writeEndElement();
}
button = vdpad->getVButton(JoyDPadButton::DpadLeft);
if (button)
{
xml->writeStartElement("vdpadButtonAssociation");
if (typeid(*button) == typeid(JoyAxisButton))
{
JoyAxisButton *axisbutton = static_cast<JoyAxisButton*>(button);
xml->writeAttribute("axis", QString::number(axisbutton->getAxis()->getRealJoyIndex()));
xml->writeAttribute("button", QString::number(button->getJoyNumber()));
}
else
{
xml->writeAttribute("axis", QString::number(0));
xml->writeAttribute("button", QString::number(button->getRealJoyNumber()));
}
xml->writeAttribute("direction", QString::number(JoyDPadButton::DpadLeft));
xml->writeEndElement();
}
button = vdpad->getVButton(JoyDPadButton::DpadRight);
if (button)
{
xml->writeStartElement("vdpadButtonAssociation");
if (typeid(*button) == typeid(JoyAxisButton))
{
JoyAxisButton *axisbutton = static_cast<JoyAxisButton*>(button);
xml->writeAttribute("axis", QString::number(axisbutton->getAxis()->getRealJoyIndex()));
xml->writeAttribute("button", QString::number(button->getJoyNumber()));
}
else
//.........这里部分代码省略.........