Page 1 of 1
How to post user events? (solved)
Posted: Sun Sep 25, 2005 2:49 pm
by CZestmyr
As the Subject of this thread says: I'd like to know how you post user events to the Irrlicht Device. I tried the method postEventFromUser(SEvent event) of the scene manager, but it doesn't work.
Posted: Mon Sep 26, 2005 6:36 am
by etcaptor
Here is an example. I use it to post events from my win forms
You ust define your event:
Code: Select all
void __fastcall TForm1::Form1KeyDown(TObject *Sender, WORD &Key,
TShiftState Shift)
{
SEvent event;
event.EventType =EET_KEY_INPUT_EVENT;
event.KeyInput.Key = Key;
event.KeyInput.Control = false;
event.KeyInput.Shift = false;
if(Key == 17)
event.KeyInput.Control = true;
if(Key == 16)
event.KeyInput.Shift = true;
device->postEventFromUser(event);
}
//--
Solved
Posted: Mon Sep 26, 2005 4:46 pm
by CZestmyr without login
Thanks, I'll probably have to upgrade to 0.12 (my current version is 0.10), because I can't find any postEventFromUser(...) method in the irrlichtDevice class. Anyway, I solved this problem by creating my own special event listener interface and my own event class
.
Consider this thread solved.