Noticed the behaviour below while working on the screen refresh for Lua scripts.
Running scripts in and out of ALT mode has the following states:
1. Script is run from ALT mode via shutter press, script does not call exit_alt and user does not press ALT button
- gui_handler = script handler
- shutter button = ends script
- ALT button = exit alt mode, script continues running
- Other buttons = can be handled in script, not handled by CHDK or firmware
2. Script is started in ALT mode as per 1, script calls exit_alt() or user presses ALT button (script continues running)
- gui_handler = default handler
- ALT button = re-enters ALT mode
- Other buttons = can be handled in script, also handled by firmware
3. Script is running in ‘default’ mode as per 2, script calls enter_alt()
- returns to state 1
4. Script is running in ‘default’ mode as per 2, user presses ALT button
- gui_handler = ALT mode handler
- shutter button = kills running script then starts selected script immediately
- ALT button = exit alt mode, script continues running
- Other buttons = can be handled in script; but also handled by CHDK UI (e.g. Menu button can be processed in script and will also open CHDK menu)
I think state 4 should behave the same as state 3 and set the gui_handler to the script handler; but there might be a reason for the above behaviour that I am not aware of.
Any thoughts?