How can i switch screen with different way

Hi guys
İ want to explaine my question one example ,

When it was running A screen , i click x button .Opening B screen and B screen run t . If i click y button in A screen .B screen run k.
how can it?
i hope to i explained

Store screen name on button click.

Tip 1 here :point_down: can help you