So when I first started with Indigo, my first course would be to create a different trigger for whatever action I wanted to happen. If a KPL button was turned on, do this... and if turned off, do that.
And while this was an acceptable way to do things, I finally learned just a little bit of Python to have one trigger, and then a bunch of If/Then statements. That cut down on the number of triggers I needed to get a group of related actions done.
Current case in point:. If one of the buttons on this devices is pressed once, it will increase the volume on an audio device, if pressed twice, it will decrease the volume, and if pressed 3 times, will toggle the mute function. As it is, I have 3 separate triggers set up to do all this, and it does work just fine. But it just seems more economical and tidy (not to mention much easier to keep tabs on) to try to set this up via a python script, that can figure out how many times I've pressed the button, and respond accordingly.
Of course, I have no idea if this is even possible... and I don't expect anyone to spend time figuring it out if this isn't something already known.