Use tool buttons instead of pushbuttons. There is a high chance they'll be working as you expect it out of the box.