CHDK script - inconsistencies with ALT mode - page 3 - General Discussion and Assistance - CHDK Forum
supplierdeeply

CHDK script - inconsistencies with ALT mode

  • 31 Replies
  • 6728 Views
Re: CHDK script - inconsistencies with ALT mode
« Reply #20 on: 08 / May / 2021, 17:45:23 »
Advertisements
Quote
To allow consistency and maybe reduce confusion I'm thinking we should:
- change the <ALT> text at the bottom to something else when a script is running in alt mode - e.g. <SCR>
- if a script is running the alt button would cycle between <ALT>, <SCR> and normal modes.

That way you could return to the script mode and cancel the script, or alt mode to change CHDK settings.

The 'enter_alt' Lua function would always go to <SCR> mode.

This sounds a positive move to me.


As an aside, do you think the histogram differences I’m seeing have anything to do with the display developments? Should I report this with a new post?

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: CHDK script - inconsistencies with ALT mode
« Reply #21 on: 08 / May / 2021, 17:57:59 »
As an aside, do you think the histogram differences I’m seeing have anything to do with the display developments? Should I report this with a new post?


Hard to say - can you get some screenshots (from chdkptp if possible) and post them to the bitmap display thread.

CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

*

Offline reyalp

  • ******
  • 14114
Re: CHDK script - inconsistencies with ALT mode
« Reply #22 on: 08 / May / 2021, 18:01:36 »
One thing that occurs to me is that the current behaviour (state 4) allows you to change CHDK settings while a script is running.
I see the point, but I wonder if it's adding more complication (and potential confusion) for something that hasn't been requested up to now. It feels like it could add even more corner cases.
Does script need a way to detect <alt> vs <scr>? Since keys are passed through, probably so. Navigating the CHDK settings would not be very useful if it makes your script go crazy.

What if script uses enter_alt() / exit_alt() while in <alt> rather than <scr>?

What if the user goes to the script menu and starts a new script?

How does "start script on alt" behave?

My gut reaction is eliminating state 4 simpler and more consistent.

One other thing we should probably keep an eye on is the behavior of script calling the file browser and textbox.

What is the downside/risks, once Phil sorts out the weirdness, of switching back and forth between ALT and non-ALT, when a script is running.
The weirdness is the downside  / risks, so it should be fine if Phil fixes it in a way that still meets your needs.
Don't forget what the H stands for.

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: CHDK script - inconsistencies with ALT mode
« Reply #23 on: 08 / May / 2021, 19:22:41 »
I see the point, but I wonder if it's adding more complication (and potential confusion) for something that hasn't been requested up to now. It feels like it could add even more corner cases.
Does script need a way to detect <alt> vs <scr>? Since keys are passed through, probably so. Navigating the CHDK settings would not be very useful if it makes your script go crazy.


This is what happens today - leaving and re-entering ALT mode while a script is running ends up with both the script and CHDK alt mode handler processing the button presses.


I agree it is not ideal and potentially confusing - what I'm suggesting is a way to both keep the current behaviour, and access the better behaviour while also providing an on screen indication of the difference.

CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)


*

Offline reyalp

  • ******
  • 14114
Re: CHDK script - inconsistencies with ALT mode
« Reply #24 on: 08 / May / 2021, 20:30:26 »
This is what happens today - leaving and re-entering ALT mode while a script is running ends up with both the script and CHDK alt mode handler processing the button presses.
Yes, and the current behavior is unintended and bad, IMHO.

If we're going to make entering / leaving alt while a script is running have a well defined behavior (a good thing, IMO), we should focus on making it useful and consistent, not preserving the way it ended up by accident.

Quote
I agree it is not ideal and potentially confusing - what I'm suggesting is a way to both keep the current behaviour, and access the better behaviour while also providing an on screen indication of the difference.
I am definitely not in favor of keeping the current unintentional, poorly defined behavior in the name of backward compatibility.

If there is a need to access CHDK settings while a script is running, we should implement it in a way that's actually useful. Without a way for the script to detect this state, the usefulness seems extremely limited, while the scope for additional confusion, corner cases and bugs seems large.

This is not symmetric with keys going to the Canon UI, because script *can* detect whether it's in alt or not. It wouldn't be terribly hard to make script able to distinguish between <scr> and <alt>, but I'm not convinced there's a need that justifies it.
Don't forget what the H stands for.

Re: CHDK script - inconsistencies with ALT mode
« Reply #25 on: 09 / May / 2021, 01:39:22 »
@philmoz / @reyalp

I never saw a need to allow the user to enter the CHDK menu with a script running, this seems dangerous to me. As said above, we don’t want to allow users to try and start another script. Having said that, could they do it with key presses now with set_config-state?

What I do see are the advantages of scripters being able to use exiting ALT in their script. That is have a script able to function in two states.

For example,  my script is running and the histogram is not shown. I press ALT to exit ALT mode and the script detects this and shows the histogram and, in the case of my M3 DoF script the info bar changes to now show exposure feedback info, rather than just focus. All this is achieved without hijacking a key, ie we are using the ALT key to change the script’s state.

This ability for a script to have two running states, is, I believe, a powerful  attribute. My M3 script does this and it works well, IMHO.
« Last Edit: 09 / May / 2021, 04:10:21 by pigeonhill »

Re: CHDK script - inconsistencies with ALT mode
« Reply #26 on: 09 / May / 2021, 05:04:36 »
@philmoz

Just some user feedback.

If I set an alternative ALT exit button in my script, eg VIDEO, it works, but...

I exit ALT when my script is running and the renter ALT.

What I notice is that immediately I renter the VIDEO key doesn’t work. However, if I press full shutter, no shutter action occurs, then the VIDEO exit key, the exit works.

As I say, just reporting.

Cheers

Garry

*

Offline reyalp

  • ******
  • 14114
Re: CHDK script - inconsistencies with ALT mode
« Reply #27 on: 09 / May / 2021, 13:04:50 »
I never saw a need to allow the user to enter the CHDK menu with a script running, this seems dangerous to me.
I can imagine cases where it would be useful, but agree, they seem much less compelling than your case for accessing the regular Canon UI.

For most scripts, it seems like exiting the script to access the CHDK menu shouldn't be a big deal, while for accessing the Canon UI, there's real value to having the script run in the background.
Quote
Having said that, could they do it with key presses now with set_config-state?
You can change most CHDK settings with set_config_value, but to interactively change them while a script is running the script would need to provide a UI. Other CHDK features like the text file reader aren't available.
Don't forget what the H stands for.


*

Offline Caefix

  • *****
  • 947
  • Sorry, busy deleting test shots...
Re: CHDK script - inconsistencies with ALT mode
« Reply #28 on: 10 / May / 2021, 12:11:33 »
Pressing <alt> key in textbox is an accident ... :o
All lifetime is a loan from eternity.

*

Offline Caefix

  • *****
  • 947
  • Sorry, busy deleting test shots...
Re: CHDK script - inconsistencies with ALT mode
« Reply #29 on: 10 / May / 2021, 15:59:56 »
 :-X No idea, how to use, but somehow possible. Running & finished...
Maybe needs bavarian mouse-driver-licence  :lol
All lifetime is a loan from eternity.

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal