Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - Jip-Hop

Pages: [1]
Scripting Q&A / Double Press issues
« on: July 11, 2019, 05:25:34 PM »
This script should disable all keys, and log if there was a single or double keypress within 3 seconds.
When you run this script, I'd expect you'd be unable to navigate out of the menu.
Single presses are ignored.
But when you double press, it responds as a single press...
How's that possible with return false on all key events?

Code: [Select]
-- Double Press
-- Not working

key_counter = 0
function check_double_press()
    if(key_counter == 2) then
        -- Double press
    elseif(key_counter == 1) then
        -- Single press
    key_counter = 0
    return false

event.keypress = function(k)

    key_counter = key_counter + 1
    if(key_counter == 1) then

    -- Don't respond to any keys
    return false


Scripting Q&A / Slow to close ML menu
« on: July 09, 2019, 01:31:12 PM »
When I close the ML menu from a script, it flashes first, then closes but briefly shows a slider with "Darker" and "Brighter" on each end (I guess it's the exposure compensation slider) and then goes to Live View. It's quite slow, almost 2 seconds on my EOS M with Danne's crop_rec_4k_mlv_snd_isogain_1x3_presets_2019Jul01.EOSM202.

But when I'm in the ML menu, pressing the canon MENU button goes back to Live View instantly! How can I instantly quit the ML menu and go to Live View from a LUA script?

Code: [Select]
-- INFO key menu

event.keypress = function(k)
    -- Check if INFO key is pressed
    if k == KEY.INFO then
        return false;

Scripting Q&A / Help with MF + one shot AF for EOS M
« on: July 05, 2019, 01:40:54 PM »
I'm trying to make a script which will allow me to manually focus all the time, or one shot autofocus by half pressing the shutter button.
It's for my EOS M with native EF-M lenses.

I thought I'd just set the camera to MF mode in Canon menu, and trigger a lens.autofocus() from LUA and it would autofocus.
But clearly calling lens.autofocus() in MF mode doesn't work.

So I'm stuck and see two ways out.
I could switch temporarily from MF to AF mode when half pressing the shutter, call lens.autofocus() and switch back to MF.
But in the API I don't see any way to switch these modes.
I did read there's a dangerous option to set Canon properties, but didn't find the API to do so (and frankly I don't know if I dare to risk soft bricking the camera xD).

Another option would be to detect turning the focus ring when staying AF mode.
And then implement manual focusing in LUA, but seems like more work and I'd rather rely on the Canon MF implementation.

I thought this was going to be an easy fix xD

By the way, there's the AF+MF mode.
But MF is only allowed after an autofocus operation while the half shutter is still pressed.
So that's not true MF if you ask me.
Perhaps I could trick the camera in staying in the post-AF state, which would allow MF, and start a new AF operation on half shutter press?

Code: [Select]
-- AF KEY in MF mode 

-- Half press shutter button to autofocus if in manual focus mode

function try_af()
    local focus_lock = lens.autofocus();
    if focus_lock == true then
        display.notify_box("LOCKED ON");
        display.notify_box("NO LOCK");

event.keypress = function(key)
    if key == KEY.HALFSHUTTER then

        -- TODO: check if there's no chipped lens
        -- In that case toggle magic zoom for manual focus
        -- Maybe use CHIPPED_LENS constant?

        -- Handle key as usual in AF mode
        if == true then
            return true;


        return false;

Pages: [1]