While looking at the backlight off patch waterwingz posted in
http://chdk.setepontos.com/index.php?topic=8997.msg104053#msg104053 I decided to take a look for cleaner option.
On my cameras, the following eventprocs turn off and on the display completely, and stay in effect after shooting. MF remains enabled through an off / on cycle (unlike normal display off on a540, which kills the MF setting) AFL also stays in effect. You can also turn of the display in play mode, which is not normally possible. The live view remains active, so this will not have the battery saving of the modes that turn the sensor off. It's more like the video plug trick.
DispCon_TurnOffDisplay
DispCon_TurnOnDisplay
The registration function for A540 is DispDev_EnableEventProc. On D10 it can also be registered with DispDev.Create (I assume on later cameras only DispDev.Create works)
D10 does not have a native display off mode. I'd like to know if it works on other cameras like this, and whether anyone sees any side effects.
Issues I've seen so far:
- Switching between rec and play with the display off seems to crash.
- if you turn the display off and on in play mode, the review picture is no longer visible. Switching images makes it show again.
- the bitmap ui overlay (both chdk and canon) may not display after turning on, until you do something that causes the canon firmware to refresh it.
Assuming this works widely, I think we should add it as a standard script function so people don't have to enable native calls.
I also found that LcdCon_SetLcdBackLightBrightness stays in effect after shooting. It appears to accept values between 0 (off) and 100. 1 is darker than the range allowed in the canon menu, and I think 100 is slightly brighter.
To use this in Lua, the following should work with native calls enabled
if call_event_proc'DispDev_EnableEventProc' == -1 then
if call_event_proc'DispDev.Create' == -1 then
error'eventprocs not found'
end
end
call_event_proc'DispCon_TurnOffDisplay'
-- do whatever you want to do while the display is off
call_event_proc'DispCon_TurnOnDisplay'
Not that if your script ends with the display off, you may need to reboot to get it back on. On cameras that have a native display off mode, cycling through that should get it back.
edit:
Some related eventprocs are listed here
http://chdk.wikia.com/wiki/User:ReyalP/EventProcNotes#DispDev_EnableEventProc