onEnterPress and onEscPress directives