@reyalp
This post, https://chdk.fandom.com/wiki/User:ReyalP/EventProcNotes, gives an idea of what should be possible, but where do I find the info about the call’s name, eg what does MoveFocusToFarRelative actually do and how do I use it in Lua.
Obviously, I appreciate that this kind of info might not be available, and if that is the case, then my next best ask is to look at others’ scripts that exploit event procs.
That's pretty much it. Unless someone else has already figured it out, to use an event proc you need to either reverse engineer from disassembly or experiment.
For the EOS M cameras, the lens / focus eventprocs are quite different from P&S. Many of the ones from the P&S exist, but are no-op in the EOS firmware i.e. just a return, return 0 etc.
You can find many of the eventprocs that exist in a port from the funcs_by_*.csv files like
https://app.assembla.com/spaces/chdk/subversion/source/HEAD/trunk/platform/m3/sub/120f/funcs_by_name.csvA few notes
* Not everything in there is an eventproc. Generally stuff with camel case names and ending in _FW is (don't include the _FW when using call_event_proc, it's a suffix the sig finders add so we can distinguish the firmware version of a function and one we call in CHDK)
* Functions that appear in stubs may be no-op as described above.
* Most of the eventprocs need to be registered by calling another event proc (e.g. System.Create gets you malloc, some file IO functions etc)
* Calling an unregistered eventproc returns -1. Registered eventprocs might ALSO return -1, but usually they return 0 on success or some specific value they are intended to get.
* The registration functions are often named like Foo.Create or FooRegister... or InitializeFoo...
* You can call functions directly using the address from the csv with call_func_ptr, but you must use the address for your specific firmware version, and for eventprocs, you may need to pass arguments by reference rather than value.