Allowing scripts to trap full & half press shutter button activations - page 6 - General Discussion and Assistance - CHDK Forum  

Allowing scripts to trap full & half press shutter button activations

  • 57 Replies
  • 8656 Views
*

Offline lapser

  • *****
  • 1093
Re: Allowing scripts to trap full & half press shutter button activations
« Reply #50 on: 15 / September / 2013, 01:18:02 »
Advertisements
Normally, I'm in favor of more script control, but I think it might be confusing to have a different abort key for each script. Windows has one abort key: ctrl+alt+delete. I've been using the <ALT> key as the script abort key, and it's pretty easy to get used to.

Pressing the <ALT> key to abort the script leaves you in <ALT> mode, which might be a little confusing, but it's consistent at least. You know you're using <ALT> to abort the script when you do that, and you expect to stay in <ALT> mode. Of course, you could abort the script AND exit <ALT> mode too if that seems better.

I do like having a modified <ALT> display line when a script is running.

While we're at it, how do you like the idea of also eliminating the shutter key as the script start key? I take a lot of unwanted pictures trying to start a script when I'm not in <ALT> mode. I'm thinking it would be good to make the first option in the script menu "Run Script". Pressing <set> once takes you to that menu option, and pressing it again starts the script. That is, you double click the <set> button to start a script. This also corresponds to the Windows double click of the mouse to run a program. You'd have to check the auto-select 1st selection for double click to work, but I don't think that's a problem. If you're changing the script abort key, this would be a good time to change the script start method if you want to.

None of this is a big deal to me, so whatever you want to do is fine.

[EDIT]
Quote
Quote
alt_key_abort.patch :  makes the <ALT> key the permanent and only script abort key.
I'd be OK with this, but in addition to the issues waterwingz brought up earlier, I think a broader consideration of what alt mode means is required (ref http://chdk.setepontos.com/index.php?topic=10589.0 )
There are actually 2 <ALT> modes. <ALT> with script not running, and <ALT> with script running. Pressing <ALT> currently always switches you to normal mode. I think that behavior shouldn't change.

In <ALT> script running mode, pressing <ALT> sends you to normal mode, with the script still running. Thus, we have a 4th state, normal mode with script running. In this state, the script sees keystrokes but they are also sent to the camera. Most scripts aren't aware of this, and there is no visible indication that the camera is in this mode.

The Lua functions, exit_alt() and enter_alt(), provide this same functionality but ensuring that the script is aware of it.

So I think the best solution is for the <ALT> key to always abort the script, but then switch you out of <ALT> mode. So when you're not in <ALT> mode, you know a script isn't running (unless the script is specifically designed to do that.).
« Last Edit: 15 / September / 2013, 12:15:28 by lapser »
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

Re: Allowing scripts to trap full & half press shutter button activations
« Reply #51 on: 15 / September / 2013, 16:32:09 »
Normally, I'm in favor of more script control, but I think it might be confusing to have a different abort key for each script.
That's up to the script writer then.  And as the script source code always exists,  its not like it will be a big mystery or something the user can't change if he/she so desires.

Quote
Windows has one abort key: ctrl+alt+delete.
Unless of course you are using an application that honors the ESCape key .. or F10  .. or F4 .. or ctrl-X ... or ctrl-C .. or ctrl-S .....   

FWIW - ctrl-alt-delete  is not really a great way to terminate a running application in Windows.  Its more a "last resort" suitable for shutting the system down.  More like pressing the power button on your camera.

Quote
I've been using the <ALT> key as the script abort key, and it's pretty easy to get used to.
I think we understood your preference the first couple of times you posted it here.  Lacking any additional data,  I don't think there is anything more to say.

Quote
While we're at it, how do you like the idea of also eliminating the shutter key as the script start key?
If there is a vote on this - I don't like the idea much. Sorry.  It's two more presses on the little buttons on the back of the camera rather than an easy push of the shutter key.  Which on every camera I own is synonymous with "make something happen" and easy to remember.

Quote
There are actually 2 <ALT> modes. <ALT> with script not running, and <ALT> with script running. Pressing <ALT> currently always switches you to normal mode. I think that behavior shouldn't change.
I think this has been discussed at length here : http://chdk.setepontos.com/index.php?topic=10589 although not necessarily resolved.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline reyalp

  • ******
  • 12074
Re: Allowing scripts to trap full & half press shutter button activations
« Reply #52 on: 15 / September / 2013, 17:11:51 »
While we're at it, how do you like the idea of also eliminating the shutter key as the script start key? I take a lot of unwanted pictures trying to start a script when I'm not in <ALT> mode. I'm thinking it would be good to make the first option in the script menu "Run Script".
I am not in favor of this. For shooting related scripts, shutter is intuitive, and it's been that way for a long time so I'm not inclined to change it without a compelling reason. Also, it raises the question of what shutter would mean in alt mode.

I am in favor of making all or most keyboard actions configurable. In that case, you'd be free to assign "start script" to whatever button you wanted, or none at all. Having a "run" option on the script menu wouldn't be a bad idea in this case, so people could unassign it but still be able to start scripts.
Don't forget what the H stands for.

*

Offline lapser

  • *****
  • 1093
Re: Allowing scripts to trap full & half press shutter button activations
« Reply #53 on: 15 / September / 2013, 18:16:20 »
I am in favor of making all or most keyboard actions configurable. In that case, you'd be free to assign "start script" to whatever button you wanted, or none at all. Having a "run" option on the script menu wouldn't be a bad idea in this case, so people could unassign it but still be able to start scripts.
I like that idea. You have a menu option for the script start key, like the current <alt> key options.  That way the user sets his own keys for his own camera, and they are consistent for him. It could default to shoot_full.

It looks like you can only start a script with the shutter key when you're in <ALT> mode, and the CHDK menu isn't active. Is that correct? If so, then the only key that you couldn't use as a script start key would be the MENU key?
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos


Re: Allowing scripts to trap full & half press shutter button activations
« Reply #54 on: 15 / September / 2013, 18:30:36 »
It looks like you can only start a script with the shutter key when you're in <ALT> mode, and the CHDK menu isn't active. Is that correct?
Yes.  Unless you count the "autorun at startup" mode.  Or chdkptp ....

Quote
If so, then the only key that you couldn't use as a script start key would be the MENU key?
Why?  If you want to be able to reassign keys,  you might as well go all the way and let the user reassign the Menu key to whatever he/she wants it to do.

Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline lapser

  • *****
  • 1093
Re: Allowing scripts to trap full & half press shutter button activations
« Reply #55 on: 16 / September / 2013, 01:47:04 »
Quote
If so, then the only key that you couldn't use as a script start key would be the MENU key?
Why?  If you want to be able to reassign keys,  you might as well go all the way and let the user reassign the Menu key to whatever he/she wants it to do.
I was thinking you need the menu key to get out of the <alt> mode CHDK menus before the script would start. I guess you could press the menu key again to start the script, but I bet that would lead to a lot of accidental script starts. But someone might like it, so yeah, go all the way!
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

Re: Allowing scripts to trap full & half press shutter button activations
« Reply #56 on: 16 / September / 2013, 06:53:50 »
    I was thinking you need the menu key to get out of the <alt> mode CHDK menus before the script would start. I guess you could press the menu key again to start the script, but I bet that would lead to a lot of accidental script starts.
    I'm guessing that key usage will probably remain somewhat context sensitive (modal) if / when they become re-assignable.   

    So you could assign the Menu key to be the required key for each of these modes :
    • enter the CHDK menus when you are in plain <ALT> mode
    • exit the CHDK menus when you are in CHDK menu mode
    • exit a script when you are in script menu mode

    all at the same time and have no conflicts. 

    If you also used it to

          4.  start a script while in plain <ALT> mode

    then you would need to assign some other key to

          5. enter the CHDK menus when you are in plain <ALT> mode

    or you would not be able to use the menus
    [/list]
    « Last Edit: 16 / September / 2013, 07:02:41 by waterwingz »
    Ported :   A1200    SD940   G10    Powershot N    G16

    *

    Offline lapser

    • *****
    • 1093
    Re: Allowing scripts to trap full & half press shutter button activations
    « Reply #57 on: 16 / September / 2013, 10:37:04 »
    I'm guessing that key usage will probably remain somewhat context sensitive (modal) if / when they become re-assignable.   
    It all seems really complicated with all this re-assigning, the more I think about it. The only problem with the current way of starting a script for me is that I take pictures with the shutter key accidentally. If you can only start a script in pure <ALT> mode now, i.e. not in a CHDK menu, then pressing the <set> key twice would have the same effect as the shutter key at that point. The <set-set> method would also show you what's happening, because you see the menus come up. This seems like the clearest way to start a script to me.

    A menu option that also activates the shutter key for script start would be OK for legacy reasons. But I don't think it's a big deal to change the script start to <set-set> as the only option, although there might be complaints at first. The same goes for the <ALT> key as the only script abort. Sometimes progress requires throwing out the old methods when a better one appears.
    EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
    https://www.youtube.com/user/DrLapser/videos


     

    Related Topics