« Reply #23 on: 21 / December / 2014, 17:29:50 »
I was suggesting a new function (e.g. console_timeout(N)) to allow scripts to update conf.console_timout without needing to use a magic number or load cnf_osd.lua.
To remove the need for scripts to save & restore the value (and to cater for the user cancelling the script) I was suggesting the core C code save and restore conf.console_timeout when running a script (same as it now does for the script autosave flag).
If we're about to introduce a new function (or extend an existing one), I wonder if it would be better to add a new variable, instead of saving/changing/restoring the timeout value.
That's what I was thinking too - sorry for the confusion. Add a flag to the console timeout logic that can be set by a script function ( disable_console_timeout(0/1) ). Regardless of how the script uses that function, clear the flag on script exit.
Ok, understand now.
Would you also want the ability to turn the console off completely while the script was running?Not needed - the console_autoredraw function takes care of it.
Edit: Why not just disable the console timeout if a script is running and leave the console displayed? No change required to any scripts that way. When the script exits the timeout kicks back in.
Phil.
« Last Edit: 21 / December / 2014, 17:38:51 by philmoz »
Logged
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)