You can create a MIDI device that just has one button mapped to sustain. It’s an old Cubase feature but still available, and not that hard to do. The button would be clickable, not sure if you can map a key stroke to it, but possibly. It might be what you’re after.
For live performance, it really is a lot easier and more natural to map sustain to a physical slider or knob or button on your controller to do this.