I tested using an Apple Wireless Keyboard (the one that uses 2 AA batteries), late 2012 i5 Mini, Mojave, no wired keyboard connected.
When you hear the boot chime, immediately press the shift key. The Mac will do safe boot.
The preferable USB keyboards are Apple USB keyboards. Although other brands should work but it may have some setbacks. For example, only modifier keys on one side may work as startup keys. I have an Apple ADB keyboard connected through an iMate ADB to USB adapter. Only the Option key on the left works to boot into Startup Manager. And while both Shift keys work to boot into Safe Boot in OS X, none of them can boot OS 9 with Extensions Off [update: OK, found the cause for the shift key not working to boot with extensions off in OS 9, it conflicts with my USB Wacom]
, I have to use an Apple USB keyboard for that. The iMate may have something to do with the issue.
Would any USB keyboard work? I have a few of those lying around, but I thought the keyboard would have needed to be set up with the Mini first so that it would recognize it when powered on.
No biggie, once you plug it in, you will be automatically asked to press some keys (probably the Shift keys) to identify the keyboard layout.