There should be an option to transpose the newly chosen root note to C Major before scale keys are mapped. This would make the scale constrained to all the white keys without duplicate notes.
Most other implementations of a scale lock feature include this option (Scaler VST, Blokas MIDI Hub, etc.)