2 buttons yield

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By MakLinux

I have 2 buttons and wait if both are pressed.


But if the user turns the order when pressing?
How can I query both variants?

:bust_in_silhouette: Reply From: TyTYctA

I can try this

func my_func():
        yield(button_func(), "completed")
        print("All buttons were pressed, hurray!")

func button_func():
    yield($Button0, "pressed")
        yield($Button1, "pressed")

for more detail at Coroutines & signals

func button_func():
  yield($Button0, "pressed")
    yield($Button1, "pressed")

Gives : Unexpected ident.
That’s why my question.

MakLinux | 2019-03-15 21:24

this error happen because there are some spaces before yeild, they are not tabs.
you need to replace all spaces before yeild to tabs
enter image description here

TyTYctA | 2019-03-16 00:46

My sreenshot

MakLinux | 2019-03-16 06:31