Playback button not in the buttons list? And other questions - LUA Scripting - CHDK Forum supplierdeeply

Playback button not in the buttons list? And other questions

  • 4 Replies
  • 5712 Views
Advertisements
I'm making a lua script to fix my A1200's broken shutter button by rebinding it to zoomin/out.
And since I kinda need the script to always run, I'm always in ALT mode and the rest of the buttons should do their usual thing, because of that I found some things:

  • Playback button doesn't seem detectable.
    I've added all the buttons listed on the wiki and when I press playback none of them pass, so I have to do it by process of elimination. Is this a known issue and is there some other way I can do this?
  • When ALT mode is off the script still runs/detects keys but it doesn't always block the original function. With ALT off, in record mode it doesn't block but in preview mode it does which was really confusing at first... not really a question, just an observation.
  • Is it possible to invoke the CHDK menu from a script?
    As I want to have my script auto-start but then I can't use the CHDK menu without first stopping the script, and then I can't start the script without restarting the camera (because of the broken shutter button); currently I have it to start on ALT.
  • Limiting auto-exposure?
    The camera is really slow in dark scenes as it tries to increase exposure, but it actually over-exposes making my pictures unnecessarily bright and blurry (because hand held and no image stabilization), any way I can limit the auto exposure in a way that affects the live preview too?
  • Trigger white balance evaluation?
    Any better way to trigger it? Navigating the menus with the script seems really awkward and unreliable.
Thanks in advance :}

*

Offline reyalp

  • ******
  • 14121
Re: Playback button not in the buttons list? And other questions
« Reply #1 on: 09 / July / 2018, 13:53:04 »
And since I kinda need the script to always run, I'm always in ALT mode and the rest of the buttons should do their usual thing, because of that I found some things:
You might find the key handling in this script useful
https://chdk.wikia.com/wiki/Lua/Scripts:_Continuous_Autoexposure
It "forwards" most key presses to the Canon firmware while running. It should be pretty easy to re-use the keyboard part, between -- keyboard module and -- end keyboard module

Quote
Playback button doesn't seem detectable.
If it's assigned to the alt button, script won't see presses. If you re-assign the alt button, you should see playback, but whatever key you assign alt to will be hidden from script.

You should be able to send it to the Canon firmware using "playback" or "print"

Quote
When ALT mode is off the script still runs/detects keys but it doesn't always block the original function. With ALT off, in record mode it doesn't block but in preview mode it does which was really confusing at first... not really a question, just an observation.
Yes, the behavior of running script while not in alt mode is ill-defined.

Quote
Is it possible to invoke the CHDK menu from a script?
Unfortunately, no.

Quote
As I want to have my script auto-start but then I can't use the CHDK menu without first stopping the script, and then I can't start the script without restarting the camera (because of the broken shutter button); currently I have it to start on ALT.

You can change the script exit key from script, but not the script start key.

You can start a script from the user menu... but only with the shutter button  >:(

You can start a script with the hardware remote (https://chdk.wikia.com/wiki/USB_Remote). You might consider building a remote to replace your shutter button rather (or in addition to) script.

You might also consider a custom CHDK build with the buttons handled differently. Several people here could provide you with customized builds if you aren't up for doing it yourself.

Quote
Limiting auto-exposure?
The camera is really slow in dark scenes as it tries to increase exposure, but it actually over-exposes making my pictures unnecessarily bright and blurry (because hand held and no image stabilization), any way I can limit the auto exposure in a way that affects the live preview too?
Generally speaking, you can't change the the Canon auto-exposure behavior from CHDK. You should be able to use Canon firmware EV compensation if in P mode if you just want to reduce exposure. This will affect preview.


Quote
Trigger white balance evaluation?
Any better way to trigger it? Navigating the menus with the script seems really awkward and unreliable.
Not that I know of, there might be event procs.
Don't forget what the H stands for.

Re: Playback button not in the buttons list? And other questions
« Reply #2 on: 10 / July / 2018, 01:57:56 »
I'm making a lua script to fix my A1200's broken shutter button by rebinding it to zoomin/out.
If that's all you want to do most of the time, it would be quite easy to hack the CHDK build for the A1200 so that when it loads it reassigns the some other keys to be the shutter button.  Then you could just ignore the fact that CHDK is in running in the background - especially if you disable the use of the <ALT> key.

Bear in mind that there are actually two switches associated with the shutter button though- half press & full press.

You'd need to be able to rebuilt the CHDK source - or get someone else to do it for you.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Playback button not in the buttons list? And other questions
« Reply #3 on: 10 / July / 2018, 05:52:05 »
An edited CHDK build might be too much right now.
I tried a remote a while ago, it was pretty awkward to use (cable sticking out, always needing 2 hands, etc) plus that it was janky as I don't really know how to make nice physical stuff.


Hmm, 'playback' does indeed work for detecting it.
It wasn't in the wiki/ButtonNames and the way that page is phrased suggests those are the only key names I can use.
Also, ALT is on "face" and the script seems to still detect that though.


The EV adjust on the camera doesn't always affect preview, it only does when in the EV slider menu and in half shoot, but regular preview is still normally exposed, making the entire camera slow to react to anything.
Using set_aelock() and set_ev() also only affect it when half-shoot is pressed.


CHDK delays the camera startup quite noticeably, is there anything I can do to minimize that delay?

Or, maybe I can make some kind of sleep state for the camera... btw, turning off the LCD with a script doesn't close the shutter like camera's LCD toggle does, is there any battery usage difference if it's left open?

And a script doing stuff every 250ms (wait_click(150) + sleep(100) afterwards) be of any noticeable impact to the camera's battery as opposed to having wait_click() without a timeout?

My current code, if anyone wants to suggest improvements for performance or stuff.
https://pastebin.com/rkDFwFKv
« Last Edit: 10 / July / 2018, 05:58:47 by Digi »


*

Offline reyalp

  • ******
  • 14121
Re: Playback button not in the buttons list? And other questions
« Reply #4 on: 10 / July / 2018, 13:27:32 »
It wasn't in the wiki/ButtonNames and the way that page is phrased suggests those are the only key names I can use.
That page is a bit out of date. The canonical list is https://app.assembla.com/spaces/chdk/subversion/source/HEAD/trunk/modules/script_key_funcs.c
Quote
Also, ALT is on "face" and the script seems to still detect that though.
Hm, I guess I never actually checked whether script saw that. Good to know.

Quote
CHDK delays the camera startup quite noticeably, is there anything I can do to minimize that delay?
Probably not. If you are using a slow SD card, a faster one might help a little. Just in case you aren't already aware, holding the power button should allow you to start directly in shooting mode.
Turning of the CHDK splash screen won't really speed things up, but allows you to see the live view slightly sooner.

Quote
Or, maybe I can make some kind of sleep state for the camera...
None other than the normal canon power saving settings.
Quote
btw, turning off the LCD with a script doesn't close the shutter like camera's LCD toggle does, is there any battery usage difference if it's left open?
Yes, the power saving with the shutter closed also turns off the sensor, which saves a significant amount of power. Turning off just the LCD doesn't make much difference.

Quote
And a script doing stuff every 250ms (wait_click(150) + sleep(100) afterwards) be of any noticeable impact to the camera's battery as opposed to having wait_click() without a timeout?
No, it shouldn't make any detectable difference.
Don't forget what the H stands for.

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal