Processing sketches quit if no keyboard or mouse is attached to the USB ports. What is Processing doing?

I am running Processing 3.54 on a MacMini with Big Sur 11.6.1, connected to a Samsung LCD via HDMI.

I have several sketches I want to install in an art exhibition with imagery (no sound or interactivity). They work fine when placed in the Mac’s startup-sequence IF there are keyboard and mouse attached to the USB ports on the MacMini. (Bluetooth is shut off.) If I shut the computer off, remove the keyboard and mouse from the computer and restart, the sketches start to launch, then quit.

It seems obvious to me that if a sketch contains interactive elements, expecting keyboard or mouse input, the sketch may crash if Processing cannot detect a keyboard or mouse. If Processing allows pressing the esc key to quit, then it will need an attached keyboard, etc.

My questions really are:

  1. What do Processing sketches do to detect keyboard and mouse attachment to the computer causing sketches to quit when they are not present?

  2. Is there any way to get Processing to stop doing that? My hope is to attach a MacMini to the monitor in a gallery without a keyboard or mouse attached. It would simply result in a neater, more streamlined form factor for exhibitions.

I suspect people who do kiosk work with Processing and Macs have run into this issue and maybe someone out there has come up with. solution.