Fix insertion of control characters and mode after deleting selection in select mode.
Fix control key detection.