Midi learn for Ctr+Space function

Ctr+Space

This shortcut stops recording and removes the last capture.

A super useful feature, and I use it always when I am recording.

The question!

How can I assign it to the footswitch on my midi controller?

Any ideas?