You should consider 2 “presses” for the pedal:
1) quick press-release: changes mode
2) long press-hold-release: changes mode on press and then changes mode back on release
This allows the user to not have to hold the pedal down if they dont want.
User can specify a time threshold used to determine the difference between a quick press and a long press