The function returns the state of the specified push button. If the button is pressed it returns True or else False.

Function Definition: readpushbutton(button = "L")
| Name | Type | Description | Expected Values | Default Value |
|---|---|---|---|---|
| button | string | The specific button for which the state is required. | "L" or "R" | "L" |
The function returns the state of the specified push button. If the button is pressed it returns True or else False.

sprite = Sprite('Tobi')
quarky=Quarky()
while True:
if quarky.readpushbutton("L"):
sprite.move(-10)
elif quarky.readpushbutton("R"):
sprite.move(10)

Copyright 2025 – Agilo Research Pvt. Ltd. All rights reserved – Terms & Condition | Privacy Policy