Now =set_focus() and =return get_focus() work. Even during recording a video(at least in MF). So will this really disable AF ?
Behavior depends on the camera, but if you can set MF in video, then AF should indeed be disabled. In MF mode, =set_focus() should take effect immediately.
Strangely enough if I set_focus(20000) the get_focus() returns -1.
This isn't surprising. -1 means infinity (or beyond). Where it switches to -1 depends on the camera and zoom level. At wide angle, "infinity" is usually quite close.
If you want to focus on an object 2m ahead would you use half_press or set_focus(2000)? I ask b/c I got a feeling that the script focus is not really accurate.
The set_focus value is in mm, so you would use set_focus(2000) to focus at 2m, and indeed, the value isn't necessarily well calibrated.
But maybe it's b/c the DOF of the camera (so that focus(1) and focus(20) look very similar).
The camera probably can't focus at 1mm, or even 20mm. 50 is often the minimum, but it depends on the camera.
You could use autofocus and AF lock instead. Usually in the canon firmware, you get AF lock by holding half press and then clicking the focus mode button (left on many cams)
You could do this in chdkptp with something like
=press'shoot_half' sleep(1000) click'left'
Whether it works in video probably depends on the camera.
BTW I asked before about controlling exposure during video recording and you said that this is on the risky side. Is the problem with setting the ISO value? or the shutter speed?
I wouldn't say it's risky in terms of hurting the camera. Crashing or not working, maybe.
Is there's a way at least to disable the auto exposure hunting?
You may be able to use AE lock, depending on the camera. The Canon firmware shortcut is usually hold half press and click the +/- button, but I think most cameras don't support it in video. You can try =set_aelock(1).
And last question - how can I get rid of the annoying menu that appears randomly in <ALT> mode?
If you mean the help screen, go to CHDK settings, Menu, and uncheck "Show <ALT> Help Screen"