Escape Key?

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
Hotshot2005
Posts: 6
Joined: Sun Jun 19, 2005 2:04 pm

Escape Key?

Post by Hotshot2005 »

hiya all


I am surprize that when I run all the example demo that I couldnt press Esc key rather for me to move the mouse to click red cross..

I been looking at Docment for code to press esc to quit the program

is there Scancodes(or keys) that I can used to to quit the program?

cheers
I am deaf person and give me break(and have a kitkat lol)
ijo coim
Posts: 57
Joined: Fri Mar 25, 2005 1:29 pm
Location: indonesia, jogja-jogja

Post by ijo coim »

1. you can use alt + F4 (this is there in example option)
2. you should make some code for event receiver. if you want to quit using escape, :

Code: Select all

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

{

	
	if (event.EventType == EET_KEY_INPUT_EVENT &&
		event.KeyInput.Key == KEY_ESCAPE &&
		event.KeyInput.PressedDown == false)
	{
	device->closeDevice();			
	}
...
don't forget to declare event receiver in main.

Code: Select all

MyEventReceiver receiver;
	
	//isi deklarasi device
	device=createDevice(EDT_OPENGL, dimension2d<s32>(1024,768),16, true, true, true,&receiver);
see turtorial 4 for event receiver.

hope this help.

regards,

ijo coim
Guest

Post by Guest »

My question is how to DISABLE alt/f4. Normally I would overide it in a windows event handler (non irrlicht) and just bring up a quit screen (yes.no) by setting a global quit flag.

as it is now alt+f4 (standard windows close program) can quit the app immediatley without saving possibly important game data.

so.. how to overide/intercept alt+f4 in irrlicht event reciever?
Neoecs

asdf

Post by Neoecs »

Do it as you done it before, using the win32api stuff, just fdont make a window first. It should work.
Post Reply