I actually have no idea. I hardly ever use video on my P&S cameras and when I do, I stay away from any CHDK setting after seeing what getting the wrong quality setting can do to the results. We could experiment with calling set_focus() but results are so variable between cameras in normal still picture mode that I have to wonder what the chances are in video mode that it will do anything (other than crash). Some of the focus_controller event proc might be interesting too.
Maybe somebody else has tried this?
IMHO a simple
AFL (via shoot_half) is enough, taking in account the "set_focus()" or others "focus_controller event proc" issues with some new cams.
BTW this script deserves new developments.
EDIT
I added these lines at the end of "Main Program" routine (red ones) and the AFL seems to works fine, even if the script crashes often as before.
The focus will be locked to the framed subject at every half shoot during video record.
Also added a sort of key repeat to change values.
.........while true do
show_values(tv96, av96, sv96)
repeat
draw.overdraw()
wait_click(200)
until not(is_key("no_key"))
if is_pressed("set") then
if ( vbutton == 1 ) then press("video") sleep(1000) release("video") sleep(1000)
else click("shoot_full") end
elseif is_pressed("left") then
if gui_index > 0 then gui_index = gui_index - 1 end
elseif is_pressed("right") then
if gui_index < 2 then gui_index = gui_index + 1 end
elseif ( is_pressed("up")) then -- key repeat
while(is_pressed("up")) do adjust_value(gui_index, 1) sleep(200) end
elseif ( is_pressed("down")) then -- key repeat
while(is_pressed("down")) do adjust_value(gui_index, -1) sleep(200) end
elseif ( is_key("zoom_in")) then
press("zoom_in")
while(is_pressed("zoom_in")) do sleep(20) end
release("zoom_in")
elseif ( is_key("zoom_out")) then
press("zoom_out")
while(is_pressed("zoom_out")) do sleep(20) end
release("zoom_out")
elseif ( is_pressed("shoot_half")) then --half press to AFL
press("shoot_half")
while(is_pressed("shoot_half")) do set_aflock(1) sleep(1000) end
adjust_value(gui_index, -1) -- restore AE after AFL
adjust_value(gui_index, 1)
release("shoot_half")
elseif (is_pressed("menu") or is_pressed("shoot_full")) then break
end
end
restore()