![background image](http://html.mh-extra.com/html/canon/camera/camera_hackers-manual_59969091.webp)
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
zoom_in
and
zoom_out
are the zoom rock-
ers, and the key
shoot_half
is the half-pressed shutter button. The loop
ends when the
MENU
button is pressed.
rem restore camera state
s = q
gosub "zoom"
gosub "restor"
d = o
gosub "display"
rem leave alt mode
exit_alt
end
After the
MENU
button is pressed, we clean up behind us and reset the
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
Содержание Camera
Страница 1: ......
Страница 2: ...The Canon Camera Hackers Manual ...
Страница 3: ......
Страница 4: ...Berthold Daum The Canon Camera Hackers Manual Teach Your Camera New Tricks ...
Страница 19: ...10 CH APTER 2 Cameras and Operating Systems ...
Страница 25: ...16 CH APTER 3 ...
Страница 85: ...76 CH APTER 4 Teach Your Camera New Tricks ...
Страница 213: ...204 CH APTER 6 ...
Страница 253: ...244 AP PENDIX ...