How to post user events? (solved)

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
CZestmyr
Posts: 72
Joined: Sat Feb 12, 2005 7:11 pm
Location: Czech Republic
Contact:

How to post user events? (solved)

Post 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.
Last edited by CZestmyr on Mon Sep 26, 2005 4:48 pm, edited 1 time in total.
etcaptor
Posts: 871
Joined: Fri Apr 09, 2004 10:32 pm
Location: Valhalla
Contact:

Post 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);
}
//--
ImageImage
Site development -Rock and metal online
--- etcaptor.com ------freenetlife.com
CZestmyr without login

Solved

Post 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.
Post Reply