input receiver

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
jugurdzija
Posts: 26
Joined: Thu Feb 05, 2004 10:58 pm

input receiver

Post by jugurdzija »

i have troubles geting input receiver to work
it works fine in examples but when i cut and paste the derived event receiver class and use in my app it doesnt work,it soesnt react at all,it compiles fine without any wornings?
did you have similiar problems?
i tried everything that i could think of.

please help
t2b

Post by t2b »

try this :

Code: Select all

//Eventreceiver
class MyEventReceiver : public IEventReceiver {
public:
  virtual bool OnEvent(SEvent event) {

	//Quitte l'application quand on presse echap
	if (event.KeyInput.Key == KEY_ESCAPE && event.KeyInput.PressedDown) {
		PostQuitMessage(0);
	}

    return false;
  }
};



int main() {

  //Instance of the EventReceiver
  MyEventReceiver receiver;


  //Initialise the engine
  IrrlichtDevice *device = createDevice(EDT_DIRECTX9,dimension2d<s32>(ResX,ResY),32,false,false,&receiver);
it quit the window when tou press escape.
Post Reply