Problem with overlapping key event listener

Actually I was thinking about something like that but I had enough for yesterday.

So now I did it, but in addition I had to adjust code by declare variables for pause menu ui outside functions. I think just that could repair my previous code but since it’s already working fine I won’t touch it anymore lol

Thank you!