That's how I do it.
http://forum.hauptwerk.com/viewtopic.php?f=15&t=12849&p=94757
I don't know for sure, since I build all my own MIDI interfaces, but probably most MIDI encoders intended for pedalboards will handle pistons and expression as well as notes.
Nick