I would imagine this is trivial for those that are familiar with creating brains (I'm not, complete newbie)
I'm making a hard button panel (see below), I'm using a Pokeys 57E to capture the key presses. This is working fine, I can jog, etc via the panel. Setting this up using the pokeys configuration software (Mach3 plug-in) is straight forward, just map one of the 55 input pins to the desired button in mach3 and it works.
Some of the buttons on my panel need to cycle through various modes (bottom left button) for example the SS-CON-MPG. I have this mapped to button call 245 and it works fine, HOWEVER I would like a 4th press of the button to disable jogging, and then if I press again it starts at SS.
Similar situation for the right most blue button, first push MPG is set to Jog speed, 2nd push the MPG controls feed speed and then 3rd push disables the MPG.
Can someone describe how I can create a brain to provide this functionality?