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

Method handleEvent

Engine/source/sim/actionMap.cpp:1795–1824  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1793
1794//------------------------------------------------------------------------------
1795bool ActionMap::handleEvent(const InputEventInfo* pEvent)
1796{
1797 // Interate through the ActionMapSet until we get a map that
1798 // handles the event or we run out of maps...
1799 //
1800 SimSet* pActionMapSet = Sim::getActiveActionMapSet();
1801 AssertFatal(pActionMapSet && pActionMapSet->size() != 0,
1802 "error, no ActiveMapSet or no global action map...");
1803
1804 for (SimSet::iterator itr = pActionMapSet->end() - 1;
1805 itr > pActionMapSet->begin(); itr--) {
1806 ActionMap* pMap = static_cast<ActionMap*>(*itr);
1807 if (pMap->processAction(pEvent) == true)
1808 return true;
1809 }
1810
1811 // Found no matching action. Try with the modifiers stripped.
1812
1813 InputEventInfo eventNoModifiers = *pEvent;
1814 eventNoModifiers.modifier = ( InputModifiers ) 0;
1815
1816 for (SimSet::iterator itr = pActionMapSet->end() - 1;
1817 itr > pActionMapSet->begin(); itr--) {
1818 ActionMap* pMap = static_cast<ActionMap*>(*itr);
1819 if( pMap->processAction( &eventNoModifiers ) )
1820 return true;
1821 }
1822
1823 return false;
1824}
1825
1826//------------------------------------------------------------------------------
1827bool 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