MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / handleEvent

Method handleEvent

Engine/source/sim/actionMap.cpp:1658–1687  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1656
1657//------------------------------------------------------------------------------
1658bool ActionMap::handleEvent(const InputEventInfo* pEvent)
1659{
1660 // Interate through the ActionMapSet until we get a map that
1661 // handles the event or we run out of maps...
1662 //
1663 SimSet* pActionMapSet = Sim::getActiveActionMapSet();
1664 AssertFatal(pActionMapSet && pActionMapSet->size() != 0,
1665 "error, no ActiveMapSet or no global action map...");
1666
1667 for (SimSet::iterator itr = pActionMapSet->end() - 1;
1668 itr > pActionMapSet->begin(); itr--) {
1669 ActionMap* pMap = static_cast<ActionMap*>(*itr);
1670 if (pMap->processAction(pEvent) == true)
1671 return true;
1672 }
1673
1674 // Found no matching action. Try with the modifiers stripped.
1675
1676 InputEventInfo eventNoModifiers = *pEvent;
1677 eventNoModifiers.modifier = ( InputModifiers ) 0;
1678
1679 for (SimSet::iterator itr = pActionMapSet->end() - 1;
1680 itr > pActionMapSet->begin(); itr--) {
1681 ActionMap* pMap = static_cast<ActionMap*>(*itr);
1682 if( pMap->processAction( &eventNoModifiers ) )
1683 return true;
1684 }
1685
1686 return false;
1687}
1688
1689//------------------------------------------------------------------------------
1690bool ActionMap::handleEventGlobal(const InputEventInfo* pEvent)

Callers

nothing calls this directly

Calls 4

sizeMethod · 0.45
endMethod · 0.45
beginMethod · 0.45
processActionMethod · 0.45

Tested by

no test coverage detected