本文整理汇总了C++中JoyAxisButton::joyEvent方法的典型用法代码示例。如果您正苦于以下问题:C++ JoyAxisButton::joyEvent方法的具体用法?C++ JoyAxisButton::joyEvent怎么用?C++ JoyAxisButton::joyEvent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JoyAxisButton
的用法示例。
在下文中一共展示了JoyAxisButton::joyEvent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createDeskEvent
void JoyAxis::createDeskEvent(bool ignoresets)
{
JoyAxisButton *eventbutton = 0;
if (currentThrottledValue > deadZone)
{
eventbutton = paxisbutton;
}
else if (currentThrottledValue < -deadZone)
{
eventbutton = naxisbutton;
}
if (eventbutton && !activeButton)
{
// There is no active button. Call joyEvent and set current
// button as active button
eventbutton->joyEvent(eventActive, ignoresets);
activeButton = eventbutton;
}
else if (!eventbutton && activeButton)
{
// Currently in deadzone. Disable currently active button.
activeButton->joyEvent(eventActive, ignoresets);
activeButton = 0;
}
else if (eventbutton && activeButton && eventbutton == activeButton)
{
//Button is currently active. Just pass current value
eventbutton->joyEvent(eventActive, ignoresets);
}
else if (eventbutton && activeButton && eventbutton != activeButton)
{
// Deadzone skipped. Button for new event is not the currently
// active button. Disable the active button before enabling
// the new button
activeButton->joyEvent(!eventActive, ignoresets);
eventbutton->joyEvent(eventActive, ignoresets);
activeButton = eventbutton;
}
}