Remapping the shortcut key to the record button on the sx40 - General Discussion and Assistance - CHDK Forum

Remapping the shortcut key to the record button on the sx40

  • 6 Replies
  • 6651 Views
Remapping the shortcut key to the record button on the sx40
« on: 23 / August / 2013, 11:44:57 »
Advertisements
As the title says. The shortcut key cannot be operated with one hand, so it makes for a poor alt key. The auto-framing button isn't in the best position either. The record button is in the perfect position, but enabling it as the alt key would prevent it from actually being used to take a video.

What I'd like to do would be to map the shortcut key to press the record button so that I can have the physical record button set to the alt key. I have downloaded the source code, but I have no idea of where I would put the code to do this (or what code to put there either for that matter).

I guess all I really need to do is to get CHDK to generate a record-button press once the short-cut key is pressed. If someone could point me in the right direction that would be great.

Re: Remapping the shortcut key to the record button on the sx40
« Reply #1 on: 23 / August / 2013, 12:03:08 »
The record button is in the perfect position, but enabling it as the alt key would prevent it from actually being used to take a video.
Not true.   The way the ALT key code works,  a "short" press on the button mapped as the <ALT> key gets you into <ALT> mode.   If you hold that same button down for about one second, you get the original functiontality of the button.  In this case,  it would start video recording.

Ported :   A1200    SD940   G10    Powershot N    G16

Re: Remapping the shortcut key to the record button on the sx40
« Reply #2 on: 23 / August / 2013, 12:22:42 »
Aha! That works great. Didn't realise you could do that. I think I'll use the record button like that then and keep the shortcut key for something else.

Thanks

*

Offline lapser

  • *****
  • 1093
Re: Remapping the shortcut key to the record button on the sx40
« Reply #3 on: 23 / August / 2013, 12:58:45 »
The <record> button is also in a much better position than the <play> button on the D20.

Is there a way to tell what the <alt> button is set to from a script?

On a somewhat related issue, the <alt> button and the <shoot_full>  shutter button both interrupt the script. It would be nice for the script to be able to disable this behavior, that is take control of all the buttons. If the script hangs, for some reason, there's always the power button to shut off power and restart. If anyone is interested in this idea, maybe we could start a new thread to discuss it? In addition to avoiding unwanted script termination, it would let you use the shutter button to take pictures under script control. That opens up a lot of new override possibilities.
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

Re: Remapping the shortcut key to the record button on the sx40
« Reply #4 on: 23 / August / 2013, 13:48:14 »
Is there a way to tell what the <alt> button is set to from a script?
get_config_value(75) ?get_config_info() ?

Quote
On a somewhat related issue, the <alt> button and the <shoot_full>  shutter button both interrupt the script. It would be nice for the script to be able to disable this behavior, that is take control of all the buttons. If the script hangs, for some reason, there's always the power button to shut off power and restart. If anyone is interested in this idea, maybe we could start a new thread to discuss it? In addition to avoiding unwanted script termination, it would let you use the shutter button to take pictures under script control. That opens up a lot of new override possibilities.
Read about half way through this comment : http://chdk.setepontos.com/index.php?topic=10506.msg103679#msg103679
« Last Edit: 23 / August / 2013, 17:25:02 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: Remapping the shortcut key to the record button on the sx40
« Reply #5 on: 23 / August / 2013, 15:11:07 »
get_config_info() ?

Not quite right.

Code: (lua) [Select]
core = require("gen/cnf_core")
key_table = {"up" , "down", "left", "right", "set", "half", "full", "zoom in", "zoom out",
             "menu", "disp", "print", "erase", "iso", "flash", "MF", "macro", "video",
             "timer", "expo", "micro", "face"}
print(key_table[get_config_value(core.alt_mode_button)])
The script runs only with a recent 1.3 build.

msl
« Last Edit: 23 / August / 2013, 15:13:03 by msl »
CHDK-DE:  CHDK-DE links

Re: Remapping the shortcut key to the record button on the sx40
« Reply #6 on: 23 / August / 2013, 17:15:09 »
The script runs only with a recent 1.3 build.
Or for 1.2.0 and earlier, you could just use get_config_value() with the correct index for the alt mode setting menu item - whch is what I meant to suggest.   ( i.e.  key=get_config_value(75)
« Last Edit: 23 / August / 2013, 17:45:22 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics


SimplePortal © 2008-2014, SimplePortal