detect IE/mobile. handle ESC