I have not had the opportunity to use the manual focus function. But I think that with devices with DIGIC 4 or 5 you have to save the focus mode, set the focus manually, set the focus and revert back to the previously saved.
As an example:
rc = get_prop(props.REAL_FOCUS_MODE) -- get focus status
set_prop(props.REAL_FOCUS_MODE,4) -- sets manual focus
set_focus(1000) -- set focus at 1 meter (value is expressed in millimeters)
set_aflock(1) -- lock the focus distance
sleep(500) -- sleep half a second
shoot() -- shoot
set_aflock(0) -- release the focus lock
set_prop(props.REAL_FOCUS_MODE,rc) -- restore focus mode
Otherwise you can try to set the focus distance not through the function call,
but pausing the procedure, then using the manual controls of focus to set the correct focus,
and then resume execution of the procedure blocking the value of focus setting.
I do not know if it works, I've never tried. Try it, then tell me ....
This could be an example:
rc = get_prop(props.REAL_FOCUS_MODE) -- get focus status
set_prop(props.REAL_FOCUS_MODE,4) -- sets manual focus
print("You are in manual focus") -- print msg
print("Set the focus
print("Press SET to resume")
print("script execution")
-- loop until the SET key is pressed
while true do -- during this time you can set the manual focus
wait_click(5000) -- using camera
if is_pressed("set") then
break
end
end
-- resume the execution of script
set_aflock(1) -- lock the focus distance
sleep(500) -- sleep half a second
shoot() -- shoot
set_aflock(0) -- release the focus lock
set_prop(props.REAL_FOCUS_MODE,rc) -- restore focus mode