Skip to content
Snippets Groups Projects
Commit 29a843ff authored by Kari's avatar Kari
Browse files

Fix access to middle button state.

( self.input is of type InputController which doesn't have an 'right_shoulder' attribute )
parent f12f09e5
No related branches found
No related tags found
1 merge request!104Bugfix in "Application Programming" documentation's sample code
Pipeline #6462 passed
...@@ -368,7 +368,7 @@ Here is our previous example rewritten to make use of `BaseView`: ...@@ -368,7 +368,7 @@ Here is our previous example rewritten to make use of `BaseView`:
def think(self, ins: InputState, delta_ms: int) -> None: def think(self, ins: InputState, delta_ms: int) -> None:
super().think(ins, delta_ms) # Let BaseView do its thing super().think(ins, delta_ms) # Let BaseView do its thing
if self.input.right_shoulder.middle.pressed: if self.input.buttons.app.middle.pressed:
self.vm.push(SecondScreen()) self.vm.push(SecondScreen())
st3m.run.run_view(Example()) st3m.run.run_view(Example())
...@@ -419,7 +419,7 @@ Here is our previous code changed to use `Application` for the base of its main ...@@ -419,7 +419,7 @@ Here is our previous code changed to use `Application` for the base of its main
def think(self, ins: InputState, delta_ms: int) -> None: def think(self, ins: InputState, delta_ms: int) -> None:
super().think(ins, delta_ms) # Let Application do its thing super().think(ins, delta_ms) # Let Application do its thing
if self.input.right_shoulder.middle.pressed: if self.input.buttons.app.middle.pressed:
self.vm.push(SecondScreen()) self.vm.push(SecondScreen())
if __name__ == '__main__': if __name__ == '__main__':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment