Map short ESC to IME ON/OFF and long ESC to Escape
$Esc:: KeyWait, Esc, T0.1 if ErrorLevel send,{Esc} else send,!{vkC0} keywait, Esc return