unified buttons for <ALT> mode - page 3 - General Discussion and Assistance - CHDK Forum  

unified buttons for <ALT> mode

  • 25 Replies
  • 11451 Views
Re: unified buttons for <ALT> mode
« Reply #20 on: 07 / July / 2012, 13:55:29 »
Advertisements
Maybe its time to bump this one.

I took a look at it again as I worked through the ixus115 port - it uses an horrible combination of DISP plus ZOOM-IN to activate <ALT> mode.

Short press toggle <ALT> mode, long press normal play mode. Works fine for me as option for alternate ALT button.

@msl :  when I look through the various platform/camera/kbd.c files,  it looks like this is only implemented for the ixus120, ixus220, and ixus230?    There is code in there in to use a "altDownTimer" to differentiate between short and long presses of the <ALT> key.   Or do you know if this done a different way on other cameras ?
« Last Edit: 07 / July / 2012, 14:23:51 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: unified buttons for <ALT> mode
« Reply #21 on: 07 / July / 2012, 14:35:05 »
Or do you know if this done a different way on other cameras ?

I fear there I may not to help. I can only speak for my two cameras. And they have no extra code. Both cameras have the double function (short and long press) for the Alt key.

msl
CHDK-DE:  CHDK-DE links

Re: unified buttons for <ALT> mode
« Reply #22 on: 07 / July / 2012, 16:01:33 »
I fear there I may not to help. I can only speak for my two cameras. And they have no extra code. Both cameras have the double function (short and long press) for the Alt key.

I found it (again).  Its in the kbd_process() routine in trunk/core/kbd.c.

Code: [Select]
        if ( key_pressed  && !usb_remote_active )
        {
        if (kbd_is_key_pressed(conf.alt_mode_button)
                || ((key_pressed >= CAM_EMUL_KEYPRESS_DELAY)
                && (key_pressed < CAM_EMUL_KEYPRESS_DELAY+CAM_EMUL_KEYPRESS_DURATION))) {
            if (key_pressed <= CAM_EMUL_KEYPRESS_DELAY+CAM_EMUL_KEYPRESS_DURATION)
                key_pressed++;
            if (key_pressed == CAM_EMUL_KEYPRESS_DELAY)
                kbd_key_press(conf.alt_mode_button);
            else if (key_pressed == +CAM_EMUL_KEYPRESS_DELAY+CAM_EMUL_KEYPRESS_DURATION)
                kbd_key_release(conf.alt_mode_button);
            return 1;
        } else if (kbd_get_pressed_key() == 0) {
            if (key_pressed != 100 && (key_pressed < CAM_EMUL_KEYPRESS_DELAY)) {
                kbd_blocked = 1-kbd_blocked;
                if (kbd_blocked)
                    gui_kbd_enter();
                else
                    gui_kbd_leave();
            }
            key_pressed = 0;
            return 1;
        }
        return 1;
    }

Now I just have to figure out if the extra timer code in the ixus120, ixus220 and ixus230 ports is redundant or does something different.

Ported :   A1200    SD940   G10    Powershot N    G16

Re: unified buttons for <ALT> mode
« Reply #23 on: 08 / July / 2012, 12:09:23 »
Perhaps I'm flogging a dead horse here but it seems our grand idea of using the Playback button for a unified <ALT> button is not working out.

I took a look at core/kbd.c.    Only a few cameras offer PLAYBACK as a configurable <ALT> option.
  • sx150is
  • sx220hs
  • sx230hs
  • s100
  • ixus230_elph310hs
  • ixus230_elph310hs
I don't have a quick way of figuring out which cams actually make Playback the <ALT> key but do not offer configurable <ALT> selection.

So I tried to enable it on my ixus120 and the new ixus115 port.  This behaves as follows :
 .. redacted..
The special timer code I mentioned in a previous post seems to have no effect.  And on my G10, selecting Playback (once I enable that option in the code) did not work - you could no longer enter <ALT> in any camera playback or shooting mode.

tl;dr>How well does using the playback button to start <ALT> work on those cameras that are set up that way ?


Update :  see posting farther down -  pebkac as usual.
« Last Edit: 08 / July / 2012, 17:20:35 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16


*

Offline reyalp

  • ******
  • 14118
Re: unified buttons for <ALT> mode
« Reply #24 on: 08 / July / 2012, 15:02:43 »
So I tried to enable it on my ixus120 and the new ixus115 port.  This behaves as follows :
  • If you start the camera in playback mode and press the playback button again,  the camera shuts down.
  • If you start the camera in shooting mode (or go to shooting mode after starting in playback)  and then press the playback button,  you go into <ALT> mode.
  • If you start the camera in shooting mode (or go to shooting mode after starting in playback), go back to playback mode with a long press and then press the playback button,  you go into <ALT> mode.
The first option is bad,  the other two are okay.  I think reyalp predicted this sort of behaviour here.
If the code is implemented correctly, any of the canon actions should only happen on a long press. Then what you describe is normal canon behavior for this button. If a short press triggers any canon action when play is selected as the alt button, then it's not implemented correctly.

edit:
The sx150 worked fine with play as the alt button.

edit 2:
As I mentioned earlier on IRC, some canon buttons already have a long/short press behavior (notably the print button on the cameras where canon lets you assign other functions), so assigning alt to those can cause problems. I don't think that ever applies to play though.
« Last Edit: 08 / July / 2012, 15:05:52 by reyalp »
Don't forget what the H stands for.

Re: unified buttons for <ALT> mode
« Reply #25 on: 08 / July / 2012, 15:56:23 »
Missed adding the new buttons to KEY_MASK2.   :-[
« Last Edit: 08 / July / 2012, 16:19:27 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal