How do I change the escape key?

You can try this script to acheive what you want:

map-sequence global fd %{exec <esc>}