After seeing a request in the German forum, I thought it would be a good idea to provide an override for the switch that detects whether the hot shoe is occupied. The switch can also break (report wrong status) and people put devices other than an external flash into the hot shoe (and still want to use the internal flash).
The attached patch is a first draft, the necessary changes for a camera to get support are hopefully clear. The only purpose of this patch is to add an override for the switch, flash functionality is not altered in any way. It's probably obvious that this addition is only meant for cameras with a physical hot shoe. Tested working on my g10.
Test builds are available on request.
Possible improvement: the wording (and placement) of the CHDK menu entry is kind of lame, if anybody has better suggestions, don't hesitate to tell.
The added menu entry is:
CHDK Settings -> Flash hot shoe occupied [ Auto / Off / On ]
Note that I have tried the event procedure way (UIFS_MountExtFlash, etc.) and the logical event way (MountExtFlash), none of them seemed to have an effect.
edit:
patch updated to support more cameras (g10, s5is, sx10, sx20, sx50, g7, g12)