Skip to content

Instantly share code, notes, and snippets.

@tshirtman
Created June 7, 2015 11:15
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tshirtman/31bb4d3e482261191a1f to your computer and use it in GitHub Desktop.
Save tshirtman/31bb4d3e482261191a1f to your computer and use it in GitHub Desktop.
simplest key binding demo with kivy
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.core.window import Window
class KeyDown(App):
def build(self):
Window.bind(on_key_down=self.key_action)
return Widget()
def key_action(self, *args):
print "got a key event: %s" % list(args)
if __name__ == '__main__':
KeyDown().run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment