With full keyboard gameplay active, the “P” key defaults to the same function as the escape key, including while inside a text box. This means that pushing “P” while inside a sign, command block, game chat box, recipe book, etc. Will unfocus the box or close the sign.
Extra note to add:
the E key inside the world creation/edit screen also behaves as the escape key.