Canon Camera Hackers Manual page 91

Camera hackers manual berthold daum
Table of Contents

Advertisement

82
C H A P T E R 5
Scripting
After the DigitalMacro mode is set up, the magnification is set, and the
camera is focused, the screen is cleared with cls (so that printout is re-
moved from the display). The digital magnifying glass is now ready for use.
Because the script controls all camera functions in the <ALT> mode, the
user has by default no ability to focus or to change the zoom level. If you
want to provide the user with such possibilities, you must implement the
necessary interaction.
The script does this within a do- loop where it waits for a key click. It
analyses this click and—depending on the key pressed—calls the corre-
sponding subroutine. The keys
ers, and the key
ends when the
rem restore camera state
s = q
gosub "zoom"
gosub "restor"
d = o
gosub "display"
rem leave alt mode
exit_alt
end
After the
MENU
camera to its original state. We do this by assigning the saved values for the
zoom level and display state to the transfer variables s and d, and then
calling the subroutines zoom and display again. For restoring shooting
mode, the subroutine restor is called. Finally, the script turns the <ALT>
mode off.
:zomin
click "zoom_in"
sleep 200
return
:zomout
click "zoom_out"
sleep 200
return
:focus
press "shoot_half"
do
r = get_shooting
zoom_in
shoot_half
is the half-pressed shutter button. The loop
MENU
button is pressed.
button is pressed, we clean up behind us and reset the
and
zoom_out
are the zoom rock-

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Powershot sx10 is

Table of Contents