This works as long as you’re printing via USB and you don’t plan on using the computer for other things while you’re printing.
Obtain a cheap USB mouse. Open it up and connect wires parallel across the left button switch’s normally open pins. Run these wires to a filament run out switch configured to close when filament runs out or jams. Plug the cheap mouse into the computer running Cura. When you start the print, leave the mouse point on the “Print” button, which turns into the “Pause” button in older versions of Cura’s control window. In newer versions, move the pointer to hover over the separate Pause button. That’s it! If filament runs out or jams, the kludged mouse clicks pause for you.