I programmed a hat switch on my Cougar so that when I push it in one direction, the first action is Alt key down, then 10 pixels of mouse into that direction, repeated until the switch is released, and then Alt key up (upon release). I assume you can do the same with a CH joystick. I prefer that to an on-off switch.

To do this with an on-off switch I'd say you'd have to program a flag to be turned on/off when your switch is depressed (I assume that the CH software also has flags or something) and to programe e.g. a hat switch to behave as I describe above only when the flag is turned on.