I've been thinking about just soldering a connector to the pins on the bottom of the pcb for the layer switch,then just running a cable to a foot pedal,no coding necessary.
Alternatively you could define an extra row/column in your switch matrix and wire the foot pedals directly to the controller pins,a foot pedal is just an over sized switch after all,so just treat it like you would a switch on the pcb.