jonfinerty / sublime-snake

Snake game for Sublime Text 2 & 3
68 stars 11 forks source link

Do not override "move" commands and instead implement a context #12

Closed FichteFoll closed 11 years ago

FichteFoll commented 11 years ago

Instead of overriding default "up", "down", "left" and "right" keys you can define a context for the bindings that only triggers when the "game" is running. There are several ways but the easiest would be to use an event listener, implement on_query_context() and use the defining key in the key bindings.

Docs

jonfinerty commented 11 years ago

Thanks, I'll have a look at the on_query_context() stuff.

jonfinerty commented 11 years ago

This is now implemented on the beta branch and will be merged/released in the next week or so.