Pyglet, how to make the ESCAPE key not close the window?

Posted by Bartosz Radaczynski on Stack Overflow See other posts from Stack Overflow or by Bartosz Radaczynski
Published on 2010-03-22T20:42:38Z Indexed on 2010/03/23 13:13 UTC
Read the original article Hit count: 463

Filed under:

I am writing a small sample program and I would like to override the default pyglet's behavioyr of ESC closing the app. I have something to the extent of:

window = pyglet.window.Window()
@window.event
def on_key_press(symbol, modifiers):
    if symbol == pyglet.window.key.ESCAPE:
        pass

but that does not seem to work.

© Stack Overflow or respective owner

Related posts about pyglet