use capture for esc in select mode

so that the mode can be escaped even if
a text input is focused