Fixed keyboard switching to set highlighted key position to a valid value