In both of the ways you mentioned, the game turns off.. It feels like the esc that closes the window in the game and the esc that turns off the game is set the same way.
Maybe it's a problem with my PC, not the problem with the game, but I was just wondering if there was a solution.
Thank you for your response!