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
Escape Key?
-
- Posts: 6
- Joined: Sun Jun 19, 2005 2:04 pm
Escape Key?
I am deaf person and give me break(and have a kitkat lol)
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, :
don't forget to declare event receiver in main.
see turtorial 4 for event receiver.
hope this help.
regards,
ijo coim
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();
}
...
Code: Select all
MyEventReceiver receiver;
//isi deklarasi device
device=createDevice(EDT_OPENGL, dimension2d<s32>(1024,768),16, true, true, true,&receiver);
hope this help.
regards,
ijo coim
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?
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?