Anyone interested in this sort of thing should check out mididings,[1] a python package with which you can intercept MIDI messages and use them however you like.
I've used it in combination with visgrep from the xautomation package[2] to locate and click on non-MIDI-learnable GUI buttons on a software synth, but it can be anything.
I've also used mididings to control mpv[3], allowing me to pause, play, rewind and fast-forward videos with my feet using my MIDI foot pedal controller[4] while with my hands I type up a transcript of what's being said in the video.