Added ESC handling, and shift