SX40HS Zoom Fast button undetectable - Script Writing - CHDK Forum
supplierdeeply

SX40HS Zoom Fast button undetectable

  • 10 Replies
  • 5545 Views
SX40HS Zoom Fast button undetectable
« on: 07 / August / 2012, 08:17:45 »
Advertisements
I'm having a little trouble with my SX40's zoom lever in CHDK scripting...

Like most Canon cameras, the zoom lever has 2 speeds:
  • push the lever slightly to make the camera zoom slowly
  • push the lever hard to make the camera zoom quickly
However, there doesn't seem to be a way to access the fast zoom speed through uBasic or LUA:
  • press("zoom_in") only ever zooms slowly
  • is_pressed("zoom_in") only returns true if I push the lever slightly; false if I push it hard
I've tried "zoom_in_fast", "zoom_in_1", "zoom_in_2" but they all just say error "unknown key" :(

How can I detect the fast zoom buttons in LUA?

Re: SX40HS Zoom Fast button undetectable
« Reply #1 on: 07 / August / 2012, 08:54:25 »
Like most Canon cameras, the zoom lever has 2 speeds:
None of my Canon P&S's have this feature (the two current ones I use and three older ones mothballed or give away).  Maybe its just on the higher end mega-zooms ?

Quote
How can I detect the fast zoom buttons in LUA?
Probably going to require somebody to find the appropriate bitmaps, modify the kbd.c file for the camera,  add some keyname definitions to the end of core/script.c, rebuild  and submit a patch file.  In other words,  I don't think you can do this without a developer updating the code.

Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline srsa_4c

  • ******
  • 4451
Re: SX40HS Zoom Fast button undetectable
« Reply #2 on: 07 / August / 2012, 08:58:56 »
There's set_zoom_speed for scripts, but I don't know whether it's implemented for the SX40.
See http://chdk.wikia.com/wiki/CHDK_scripting#set_zoom_.2F_set_zoom_rel_.2F_get_zoom_.2F_set_zoom_speed

update: no, it's not available for this camera.
« Last Edit: 07 / August / 2012, 09:36:16 by srsa_4c »

Re: SX40HS Zoom Fast button undetectable
« Reply #3 on: 07 / August / 2012, 09:31:39 »
There's set_zoom_speed for scripts, but I don't know whether it's implemented for the SX40.
I'm not too sure its available on recent cameras per : http://chdk.setepontos.com/index.php?topic=7071.msg76260#msg76260
Ported :   A1200    SD940   G10    Powershot N    G16


*

Offline srsa_4c

  • ******
  • 4451
Re: SX40HS Zoom Fast button undetectable
« Reply #4 on: 07 / August / 2012, 09:35:39 »
I'm not too sure its available on recent cameras per : http://chdk.setepontos.com/index.php?topic=7071.msg76260#msg76260
You're right.
SX40:
NHSTUB(SetZoomActuatorSpeedPercent, NULL_SUB)

Re: SX40HS Zoom Fast button undetectable
« Reply #5 on: 07 / August / 2012, 09:56:12 »
You're right. SX40: NHSTUB(SetZoomActuatorSpeedPercent, NULL_SUB)
Two more keys (KEY_FAST_ZOOM_IN & KEY_FAST_ZOOM_OUT) that you can look for in the sigfinder !   8)
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline srsa_4c

  • ******
  • 4451
Re: SX40HS Zoom Fast button undetectable
« Reply #6 on: 07 / August / 2012, 10:32:34 »
Two more keys (KEY_FAST_ZOOM_IN & KEY_FAST_ZOOM_OUT) that you can look for in the sigfinder !   8)
Nice try  :haha
The keys are already known, but can not be used in scripts, look into core/script.c .

Re: SX40HS Zoom Fast button undetectable
« Reply #7 on: 07 / August / 2012, 10:47:30 »
The keys are already known, but can not be used in scripts, look into core/script.c .
I mentioned the needs to update core/script.c in my OP  (http://chdk.setepontos.com/index.php?topic=8457.msg88982#msg88982) - on cameras without KEY_FAST_ZOOM_IN & KEY_FAST_ZOOM_OUT you could just set them to the same bit pattern as KEY_ZOOM_IN and KEY_ZOOM_out.

Does the sigfinder actually find both the slow and fast zoom keys ?
Ported :   A1200    SD940   G10    Powershot N    G16


*

Offline srsa_4c

  • ******
  • 4451
Re: SX40HS Zoom Fast button undetectable
« Reply #8 on: 07 / August / 2012, 10:57:38 »
Does the sigfinder actually find both the slow and fast zoom keys ?
No. The sigfinder only looks for a limited set of keys. The reason why I posted that patch is that we can't expect feedback for many old models, and even if we did, testing the On/Off and Play buttons is a bit harder then the rest.
However, the creator of the port - philmoz - has included all zoom keys in the port's kbd.c which makes the sigfinder question superfluous here.
I think the list in core/script.c could/should be expanded to include the extra zoom keys too.

Re: SX40HS Zoom Fast button undetectable
« Reply #9 on: 07 / August / 2012, 11:11:50 »
However, the creator of the port - philmoz - has included all zoom keys in the port's kbd.c which makes the sigfinder question superfluous here.
Never noticed that - but I don't have a camera with two stage zoom keys. When I grep the trunk,  I only see the zoom in & out keys.  Are there some cameras that also have fast zoom in & out ? (i.e. four zoom keys in total).

Quote
I think the list in core/script.c could/should be expanded to include the extra zoom keys too.
Sounds like a simple edit ?

Code: [Select]
static const struct Keynames {
    int keyid;
    char *keyname;
} keynames[] = {
    { KEY_FAST_ZOOM_IN,      "fast_zoom_in"    },      //** added
    { KEY_FAST_ZOOM_OUT,     "fast_zoom_out"   },   //** added
    { KEY_UP,           "up"         },
    { KEY_DOWN,         "down"       },
    { KEY_LEFT,         "left"       },
    { KEY_RIGHT,        "right"      },
    { KEY_SET,          "set"        },
    { KEY_SHOOT_HALF,   "shoot_half" },
    { KEY_SHOOT_FULL,   "shoot_full" },
    { KEY_SHOOT_FULL_ONLY,   "shoot_full_only" },
    { KEY_ZOOM_IN,      "zoom_in"    },
    { KEY_ZOOM_OUT,     "zoom_out"   },
    { KEY_MENU,         "menu"       },
    { KEY_DISPLAY,      "display"    },
    { KEY_PRINT,        "print"      },
    { KEY_ERASE,        "erase"      },
    { KEY_ISO,          "iso"        },
    { KEY_FLASH,        "flash"      },
    { KEY_MF,           "mf"         },
    { KEY_MACRO,        "macro"      },
    { KEY_VIDEO,        "video"      },
    { KEY_TIMER,        "timer"      },
    { KEY_EXPO_CORR,    "expo_corr"  },
    { KEY_MICROPHONE,   "fe"         },
    { KEY_ZOOM_ASSIST,  "zoom_assist"},
    { KEY_AE_LOCK,      "ae_lock"    },
    { KEY_METERING,     "metering_mode"},
    { 0xFF,             "remote"     },
    { 0xFFFF,           "no_key"     },
};
Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics