Here's what firmware does:
pv->buttonChangedCallback(bid, getButtonValue(bid)?4095:0, timestamps[bid]);
And it can also get called by MIDI:
getProgramVector()->buttonChangedCallback(MIDI_NOTE_BUTTON+note, velocity<<5, getSampleCounter());
Which means that value would be 0 or 4095 (0xfff) with hardware buttons and 0 - 4096 with MIDI depending on velocity (last 5 bits would be 0).
Speaking of debugging, you probably can get away with $5 or so for St-link clone and soldering a few pins. So maybe you should consider it.