Sure, but having generic stuff that needs to be reproduced in camera specific files is a source of pain, as you must know from dealing with kbd.c. I'd rather not multiply it.
Unfortunately, the change to kbd.c needed to make this work will continue to be a pain.
Sorry to be argumentative again, but as you know, I have opinions
Not a problem - the code gets better when this kind of discussion happens. I'm okay with adding a script command.
If we go with the first, the code for kbd.c and usb_sync.c in the second version has a better workflow so I'd merge that back into the first patch prior to committing to the trunk.
I should probably expand a bit on this (and rant a bit). Currently, USB remote menu setup is partially coupled to how the USB remote scripting commands work. The
USB remote enabled menu setting affects how some of the underlying code works but not other parts of it. Which can be confusing as the whole remote thing essentially works differently if you are in <ALT> than when you are not.
With my second patch, I probably make this worse. Or start to make it better, depending on how you look at it.
The first patch only works if the USB remote is enabled in the CHDK menu. Which is annoying if you are trying to use PTP.
So the second patch enables sharing use of the USB port and the precision sync functionality without needing the remote to be enabled. But it still requires the sync menu item to be selected.
This all works fine if you understand the precedence but I can see where it will be confusing (as it already is - the whole remote thing essentially works differently if you are in <ALT> than not).
So the question is whether to go with the second (more convenient) method or not ?