Is there way to fix the notes of a scale when using a midi keyboard in a way that does not have keys with duplicate notes. Basicly like a midi scale keyboard

Is there way to fix/force the notes of a scale when using a midi keyboard in a way that does not have keys with duplicate notes. Basicly use it like a software midi scale keyboard. where notes out of the scale are simply hidden. In case of the midi keyboard, the notes should just move up instead of playing the same note on two keys.
image|690x140

I hope my request is clear. thank you.