Problem with key is pressed event
Posted: Tue Jun 26, 2007 4:00 pm
How to make a key is pressed event?
I make this one but when i run the program, program crach out.
I make this one but when i run the program, program crach out.
Code: Select all
IrrlichtDevice *device = 0;
s32 cnt = 0;
class MyEventReceiver : public IEventReceiver
{
public:
virtual bool OnEvent(SEvent event)
{
s32 id = event.GUIEvent.Caller->getID();
IGUIEnvironment* env = device->getGUIEnvironment();
if (event.EventType == EET_KEY_INPUT_EVENT && event.KeyInput.Key == KEY_SPACE && event.KeyInput.PressedDown == false)
{
MessageBox(0, "asd", "ad", MB_OK);
}
return true;
}
};