Congratulations, I was getting ready to post a "setlistener" code block and I see AndersG beat me to it.
You most certainly do not want to use joysticks.xml - your button-element even if it were at the right level of the tree (which I think it is not) would not help since it tries to connect a button on a USB HID (or gameport) joystick device to the screen-capture command. If the property added into the binding is correct it'd be a property that is set by the aforementioned joystick button.
@AndersG, I am a bit confused as to why you don't think a joystick.xml config entry wouldn't work if the joystick is using it and the protocol file entries were in the correct order/position?
My written example was using "<property>/controls/screen-capture</property>" which is created by the protocol file, which was proven to capture the button click and work correctly. If a custom joystick file with all the buttons mapped correctly were employed I still don't see why that wouldn't work. Isn't that how this is typically done?
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q