Release all keys before changing state.