Set_event_handler not calling the defined method

Ok
So how can I set the same function for 2 different buttons to run once enter is pressed but with a difference inside the function determined by a parameter?

This is how I would expect to define the handles:
self.FrontLengthTextBox.set_event_handler(“pressed_enter”, self.FrontLength(self, ‘Right’))
self.LeftLengthTextBox.set_event_handler(“pressed_enter”, self.FrontLength(self, ‘Left’))

But this obviously doesn’t work based on your explanation