handle esc key
set transition type