Only if you press on the key event and check the box execute when paused. The Input Mode needs to be Ui and Game