Created
June 7, 2015 11:15
-
-
Save tshirtman/31bb4d3e482261191a1f to your computer and use it in GitHub Desktop.
simplest key binding demo with kivy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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