should the Alt key be disabled while a script is active ? - General Discussion and Assistance - CHDK Forum

should the Alt key be disabled while a script is active ?

  • 21 Replies
  • 14713 Views
should the Alt key be disabled while a script is active ?
« on: 25 / August / 2013, 10:54:44 »
Advertisements
Small patch to disable the ability to press the <ALT> key and thus exit <ALT> while a script is running as discussed here :

http://chdk.setepontos.com/index.php?topic=10580.msg104423#msg104423

This disables an annoyance when you do it by accident and prevents users from putting the camera into an "indeterminate" state.  It also makes the <ALT> key usable as in input key in some cases.

Patch works for 1.2.0 & 1.3.0.   I'd suggest treating this a bug fix and adding to both branches.
« Last Edit: 25 / August / 2013, 15:17:27 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline reyalp

  • ******
  • 14128
Small patch to disable the ability to press the <ALT> key and thus exit <ALT> while a script is running as discussed here :
I'm not sure about this. Currently, scripts continue to run when you leave alt mode, they just can't send key presses. They still receive key presses (as does the canon firmware)

I think for 1.3 we should clarify what the desired behavior is. For 1.2, I'd be inclined to just leave it the way it is.
Don't forget what the H stands for.

should the Alt key be disabled while a script is active ?
« Reply #2 on: 25 / August / 2013, 15:02:57 »
I'm not sure about this. Currently, scripts continue to run when you leave alt mode, they just can't send key presses. They still receive key presses (as does the canon firmware)
Accidentally pressing the <ALT> key while as script is running is more of an annoyance but doing it could cause strange things to happen ?

You can still exit_alt() under script control.  Can you think of a use case for doing it via the <ALT> key while a script is running?

(Spin this to its own thread ?)
« Last Edit: 25 / August / 2013, 15:17:37 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline reyalp

  • ******
  • 14128
You can still exit_alt() under script control.  Can you think of a use case for doing it via the <ALT> key while a script is running?

(Spin this to its own thread ?)
Quickly adjust something in the canon shooting menus (though if the script itself also listens for keys, this wouldn't work well) ? I have no idea if people use it this way, but it seems more like a behavior change than a bug fix to me.
Don't forget what the H stands for.

should the Alt key be disabled while a script is active ?
« Reply #4 on: 25 / August / 2013, 15:19:33 »
I have no idea if people use it this way, but it seems more like a behavior change than a bug fix to me.
Yea - not a bug.   So is the behavior change desirable  ?  Besides any annoyance factor, it does let you trap the <ALT> key for use in your script - handy for cams with only a few real buttons.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: should the Alt key be disabled while a script is active ?
« Reply #5 on: 26 / August / 2013, 20:01:39 »
After a little thought,  being able to actually use the button assigned to <ALT> in a script on cameras with few actual buttons seems even more attractive.

As my initial patch is a "no" on the assumption that somebody somewhere might want to actually exit <ALT> mode while a script is running,  is it worth me even taking the time to submit a patch with a menu item that lets you select the desire behavour?  Or a new script command? [ e.g.  alt_button_mode( mode )  ]

Or are you really saying I should drop this and the "full_press" trap patch and wait for the complete button patch:


I think I know what you want there - I suppose I could just take a whack at that instead.  The actual code that remaps button presses in real time seems easy enough.  But getting a usable UI with the existing menu code will probably be difficult. As will handling the various camera button configurations and touch screen cameras.  And whatever UI does the mapping,  a script interface to read & set button choices is going to be needed.  Other than that,  no problem :)
« Last Edit: 26 / August / 2013, 22:28:11 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline lapser

  • *****
  • 1093
Re: should the Alt key be disabled while a script is active ?
« Reply #6 on: 26 / August / 2013, 22:37:31 »
I just posted a simple patch that changes the script abort key from "shoot_full" to <alt>. See this link for more info:
http://chdk.setepontos.com/index.php?topic=10580.msg104516#msg104516

I think the current <alt> key behavior is an unintended bug. I can't imagine anyone using it. Most users don't understand what's happening when a script is running, so it's not wise to let them leave <alt> mode at any random time while running a script. The behavior of the script is unpredictable and unintended by the script writer. Furthermore, if you hold the <alt> key down while a script is running, it exits <alt> mode and sends the real <alt> keystroke to the camera. For the sx260, that switches my script to <play> mode. In any event, it trashes the script and you can't even tell it's still running. Let's fix this.
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: should the Alt key be disabled while a script is active ?
« Reply #7 on: 26 / August / 2013, 22:52:40 »
I just posted a simple patch that changes the script abort key from "shoot_full" to <alt>. See this link for more info:
http://chdk.setepontos.com/index.php?topic=10580.msg104516#msg104516

I think the current <alt> key behavior is an unintended bug. I can't imagine anyone using it. Most users don't understand what's happening when a script is running, so it's not wise to let them leave <alt> mode at any random time while running a script. The behavior of the script is unpredictable and unintended by the script writer. Furthermore, if you hold the <alt> key down while a script is running, it exits <alt> mode and sends the real <alt> keystroke to the camera. For the sx260, that switches my script to <play> mode. In any event, it trashes the script and you can't even tell it's still running. Let's fix this.

Have to disagree. I believe it would be better to fix whatever is broken and allow scripts to run correctly whether CHDK is in <ALT> mode or not. The audio meter script is a perfect example of why this would be useful.

Phil.
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)

Re: should the Alt key be disabled while a script is active ?
« Reply #8 on: 26 / August / 2013, 22:58:42 »
Have to disagree. I believe it would be better to fix whatever is broken and allow scripts to run correctly whether CHDK is in <ALT> mode or not. The audio meter script is a perfect example of why this would be useful.
While I disagree with making script abort an <ALT> key function - for reasons I've posted on the other thread - I still struggle with going out of <ALT> mode while a script is running by pressing the <ALT> key.  In the case of the audio meter script,  the script could use the exit_alt() command to get out of <ALT> mode as it was designed to run that way!  Doing it accidentally with any old script is not a good thing.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: should the Alt key be disabled while a script is active ?
« Reply #9 on: 26 / August / 2013, 23:09:20 »
Have to disagree. I believe it would be better to fix whatever is broken and allow scripts to run correctly whether CHDK is in <ALT> mode or not. The audio meter script is a perfect example of why this would be useful.
While I disagree with making script abort an <ALT> key function - for reasons I've posted on the other thread - I still struggle with going out of <ALT> mode while a script is running by pressing the <ALT> key.  In the case of the audio meter script,  the script could use the exit_alt() command to get out of <ALT> mode as it was designed to run that way!  Doing it accidentally with any old script is not a good thing.

I'd argue that running scripts in alt mode is a design flaw and by default scripts should always run in normal mode. Entering alt mode should pause the script so you can change CHDK settings. This would also allow for script menu options to abort/pause/restart the currently running script.

Phil.
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)

 

Related Topics


SimplePortal © 2008-2014, SimplePortal