Hi, Scott
You'll want to make a command that looks something like this:
Write [ Blue] 'Key Down' to log
Press down Space key
Start Loop While : Joystick 1 Button 1 Is Pressed
End Loop
Release Space key
Write [ Blue] 'Key Up' to log
You'll need to have the command triggered on a joystick button press. Note that I'm using joystick 1 button 1 in the example - yours may be different. Also, the keyboard actions are down and up only (and not press and release in one action). Also also, the 'Write to log' actions are optional - just there to show the command is working.
This can also be achieved with two commands - one triggered by a joystick button down (with a spacebar key press down action only) and another triggered by joystick button release (with a spacebar release key action only).
Hope that helps!