[PATCH] menu: fix the logic checking whether ESC key is pressed