Support replacing selection with keyboard input