user input not working

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
[BROKEN]
Posts: 12
Joined: Thu Mar 03, 2005 11:56 am

user input not working

Post by [BROKEN] »

Hi, I tried to integrate user input into my irrlicht wrapper, but nothing seems to access the onevent function, heres my main code:



eengine.cpp:

bool EGame::OnEvent(SEvent event)
{
if (event.EventType == irr::EET_KEY_INPUT_EVENT&&
!event.KeyInput.PressedDown)
{
switch(event.KeyInput.Key)
{
case KEY_KEY_W:
case KEY_KEY_S:
{
device->drop();
}
return true;
}
}
}


eengine.h:

class EGame : public IEventReceiver
{
public:
EGame();

virtual bool OnEvent(SEvent event);

private:
ISceneManager* smgr;
IrrlichtDevice* device;
video::IVideoDriver* driver;
};

obv i cut out the irrelivent bits, any help would be greatly appriciated :twisted:
[BROKEN]
Posts: 12
Joined: Thu Mar 03, 2005 11:56 am

Post by [BROKEN] »

sry, i fixed it :twisted:
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

could you please post how you fixed it? so that others may benefit from your experience.

:D
jox
Bug Slayer
Posts: 726
Joined: Thu Apr 22, 2004 6:55 pm
Location: Germany

Post by jox »

He prolly didn't register his EGame class as event receiver (i.e. pass it as last parameter to createDevice()) :)
It is like it is. And because it is like it is, things are like they are.
Post Reply