[Vala] Exit out of a Vala OpenGL program by using the ESC key



Ok,

This is a tough one to figure out.  This code does not work:

void keyboard(uchar key, int x, int y) {
    switch (key) {
        case 27:
            exit(0); break;
        default : break;
    }
}

I understand that the exit(0) call does not work in vala, so what do I replace it with so that the program can be ended without having to click the X on the window?

Thanks
Tom


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]