Handle extended keys, such as <esc> and <F12>