Method for changing key by event phase.