本文整理汇总了C++中JoyAxisButton::getAxis方法的典型用法代码示例。如果您正苦于以下问题:C++ JoyAxisButton::getAxis方法的具体用法?C++ JoyAxisButton::getAxis怎么用?C++ JoyAxisButton::getAxis使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JoyAxisButton
的用法示例。
在下文中一共展示了JoyAxisButton::getAxis方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: propogateSetAxisButtonNameChange
void SetJoystick::propogateSetAxisButtonNameChange()
{
JoyAxisButton *button = static_cast<JoyAxisButton*>(sender());
disconnect(button, SIGNAL(buttonNameChanged()), this, SLOT(propogateSetAxisButtonNameChange()));
emit setAxisButtonNameChange(button->getAxis()->getIndex(), button->getJoyNumber());
connect(button, SIGNAL(buttonNameChanged()), this, SLOT(propogateSetAxisButtonNameChange()));
}
示例2: propogateSetAxisButtonRelease
void SetJoystick::propogateSetAxisButtonRelease(int button)
{
JoyAxisButton *axisButton = static_cast<JoyAxisButton*>(sender());
JoyAxis *axis = axisButton->getAxis();
if (!axisButton->getIgnoreEventState())
{
emit setAxisButtonRelease(index, axis->getIndex(), button);
}
}
示例3: 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
//.........这里部分代码省略.........