I have little trouble understand Events in Urho.
When can I use SendEvent and which type of event I have to use?
Another question is for VarianMap, which event should I use for detect the event?
for example I use SendEvent inside HandleUpdate (from tutorial sample project) with this code:
VariantMap eData;
if (input->GetKeyPress(KEY_O))
{
eData[Update::P_TIMESTEP] = "hmm";
SEND_EEVENT = true;
}
if (SEND_EEVENT == true)
{
SEND_EEVENT = false;
SendEvent(E_UPDATE, eData);
}
but after this SendEvent() urho goes in to infinite loop and then crash. when I change eData in to eventData from function arguments, and don’t send data, then it is working and I can read “hmm” from eventData. Then I start thinking, maybe I should use SendEvent outside HandleUpdate function?