Zoomoló program CHDK-hoz - nagyítás finomhangolása

Használata (csak olyan géppel próbáltam, amin a menük kezelésére van egy tárcsa ami 4 irányba lenyomható):

* a számok a zoom integer értékeben értendők, ami ha jól tudom egy 1-127 közötti szám minden fényképezőn, ami a minimum és maximum zoom értékeket ennyi mértékre felosztja. Ez a szám kirakható a képernyőre így mindig jól követhető: CHDK settings -> OSD settings -> Miscellaneous values -> Show zoom.

A programot az SD kártya scripts mappájába kell másolni finezoom.lua néven. Az elindítása előtt a szkript tallózóban ki kell választani. Ha egyszer kiválasztjuk, utána mindig kiválasztott marad és csak futtatni kell.

Ha már aktív, akkor a CHDK ALT gomb megnyomása után egyből írja az aktív szkript nevét a konzolon (Fine tune zoom). Ilyenkor az exponálóval indítható. (Alapból egy olyan program aktív, ami nem csinál semmit.)

A program használatából eredő esetleges károkért semmilyen felelősséget nem vállalok

--[[
@title Fine tune zoom
]]

function button()
    repeat
        wait_click()
        if is_pressed "set" then
            move = 0
            quit = 1
        end
        if is_pressed "up" then
            move = 1
        end
        if is_pressed "down" then
            move = -1
        end
        if is_pressed "left" then
            move = -10
        end
        if is_pressed "right" then
            move = 10
        end
        if is_pressed "zoom_in" then
            move = 0
        end
        if is_pressed "zoom_out" then
            move = 0
        end
        if is_pressed "shoot_half" then
            press("shoot_half")
            repeat sleep(50) until get_shooting() == true
            release "shoot_half"
            move = 0
        end
    until  key ~= ""
    sleep (10)
end

move=0
quit=0
max=get_zoom_steps()-1
print("Use arrows to zoom")
print("Press SET to end")
repeat
    button()

    if move ~= 0 then
        local z = get_zoom()

        if z + move < 0 then
            set_zoom(0)
        else 
            if z + move > max then
                set_zoom(max)
            else
                set_zoom_rel(move)
            end
        end
    end
    sleep(200)
    print("Zoom = ", get_zoom())
until quit == 1