Track last button pushed on multi-button keypad (Lutron)

I have a Lutron keypad with 3 action buttons, raise and lower. I would like the raise & lower to provide an action based on the last button pressed.

The device (keypad) has several buttons and switches.

What would be the best way to determine the last button pressed?

I have these in numerous places in the house, I’d rather be able to write it generically, without having to create helper entities.