luascript.c question (was Re: chdkptp - alternative ptp client) - General Discussion and Assistance - CHDK Forum supplierdeeply

luascript.c question (was Re: chdkptp - alternative ptp client)

  • 1 Replies
  • 42 Views
*

Offline Caefix

  • *****
  • 887
  • Sorry, busy deleting test shots...
luascript.c question (was Re: chdkptp - alternative ptp client)
« on: 22 / November / 2022, 13:42:10 »
Advertisements
Just recognized 2 missing lines in luascript.c ~~270.
Are they obsolet or lost with the Ximr-merge?  ???
Code: [Select]
        if(!ptp_saved_alt_state) {  //  <--------------
            exit_alt();
        }
    }
}

int lua_script_start( char const* script, int ptp )
{
    script_shoot_hooks_reset();
    lua_script_is_ptp = ptp;
    if(ptp) {
        ptp_saved_alt_state = camera_info.state.gui_mode_alt;
        // put ui in alt state to allow key presses to be sent to script
        // just setting kbd_blocked leaves UI in a confused state
        if(!ptp_saved_alt_state) {  //  <--------------
            enter_alt(1);
        }
    }
« Last Edit: 22 / November / 2022, 14:47:35 by reyalp »
All lifetime is a loan from eternity.

*

Offline reyalp

  • ******
  • 13791
Re: luascript.c question (was Re: chdkptp - alternative ptp client)
« Reply #1 on: 22 / November / 2022, 15:02:45 »
You can use svn log and svn blame or the tortoise equivalents figure out what changed when. The lines you reference did not change in the ximr merge (r6195)

The "if" you mention around line 270 was removed in r5669 which references this forum post.

I don't honestly remember all the details, but this change appears to be intentional, with the purpose of ensuring CHDK is always fully in alt mode (rather than a mixed / confused state) when a script starts.

If you believe you've found a bug, you should describe the symptoms of the bug.

And this really doesn't belong in the chdkptp sticky thread, since it refers to CHDK code.
Don't forget what the H stands for.

 

Related Topics