How can i quantitize midi length during live midi recording?

How can i quantitize midi length during live midi recording? I want that all recorded midi note have a lengt of 1 bar.
It has to be a live input lenght quantization. I dont want to quantize the lengt after the notes are recorded.
Is there such a feature? Thank you for your help.