Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions doc/source/apis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -196,15 +196,15 @@ For instance, in your App class in Kivy::

class YourApp(App):

def build(self):
Window.bind(on_keyboard=self.key_input)
return Widget() # your root widget here as normal

def key_input(self, window, key, scancode, codepoint, modifier):
if key == 27:
return True # override the default behaviour
# the key now does nothing
return False
def build(self):
Window.bind(on_keyboard=self.key_input)
return Widget() # your root widget here as normal

def key_input(self, window, key, scancode, codepoint, modifier):
if key == 27:
return True # override the default behaviour
else: # the key now does nothing
return False


Pausing the App
Expand Down