make switching of keyboard modes more consistent