Configurable <alt> button for A620 - Feature Requests - CHDK Forum

Configurable <alt> button for A620

  • 9 Replies
  • 4009 Views
Configurable <alt> button for A620
« on: 02 / March / 2008, 08:33:08 »
Advertisements
Hi!

Is there any way we could use a different button than the "print" button for entering <alt> mode? I.e. one could choose which button to use? I found something about this for the G7, but i have the A620, and I have found nothing about this for my camera.

The reason I ask is because I use the A620 underwater in a Canon housing, and it seems like Canon did not think anyone would be printing underwater  :P . If this is possible a new world will open up for me ::) , so thank you very much in advance!

Thank you,
Aasmund.

Re: Configurable <alt> button for A620
« Reply #1 on: 02 / March / 2008, 17:14:57 »
Deleted
« Last Edit: 22 / April / 2008, 13:29:15 by Barney Fife »
[acseven/admin commented out: please refrain from more direct offensive language to any user. FW complaints to me] I felt it imperative to withdraw my TOTAL participation. Nobody has my permission, nor the right, to reinstate MY posts. Make-do with my quoted text in others' replies only. Bye

*

Offline dzsemx

  • ****
  • 302
  • [SX40HS][A650][A630]
Re: Configurable <alt> button for A620
« Reply #2 on: 03 / March / 2008, 02:02:04 »
my a630 build has no such option, too...  but it's ok for me there

*

Offline GrAnd

  • ****
  • 916
  • [A610, S3IS]
    • CHDK
Re: Configurable <alt> button for A620
« Reply #3 on: 03 / March / 2008, 02:46:36 »
I was under the impression that most all camera models supported the assignable <ALT> button now. Look under "Miscellaneous Stuff" / <ALT> Mode Button ...
In general, all models support that. But the most cameras just do not have such option visible (but the code uses full functionality, I mean short-long presses).
CHDK Developer.

Re: Configurable <alt> button for A620
« Reply #4 on: 03 / March / 2008, 02:58:20 »
So, in order to enable this on my camera, I need to do what? Edit the build code, or just make a script? I do have some coding experience, so I should be able to work it out, if someone gives me a hint on where to start... I use Allbest's build ver. 37 by the way...  :)

*

Offline GrAnd

  • ****
  • 916
  • [A610, S3IS]
    • CHDK
Re: Configurable <alt> button for A620
« Reply #5 on: 03 / March / 2008, 03:09:20 »
So, in order to enable this on my camera, I need to do what? Edit the build code, or just make a script?
Edit the sources....

In config settings there is the variable "conf.alt_mode_button" (see "core/conf.c") which is set to KEY_PRINT by default. You can just change it to an another one (and delete "CHDK.CFG" file from your SD) to use a new one permanently.

Or, there is a little bit complicated way to enable config menu. See all references to "gui_alt_mode_button_enum" function in the "core/gui.c" file. It's implemented for S*IS and G7 cameras.
CHDK Developer.

Re: Configurable <alt> button for A620
« Reply #6 on: 03 / March / 2008, 03:17:53 »
Okay, thank you for the help GrAnd :) I have some study things coming up now before easter, so I am a little busy at the moment. But I'll start looking into it during easter (or afterwards).

Finally, a good excuse for learning C :P (I have to learn it next year anyway in one of my subjects)

By the way, do developers (such as Allbest) release their sources somewhere? I guess I have to do this for every build, yes? (But then it will not take long when I know what to do...)

*

Offline GrAnd

  • ****
  • 916
  • [A610, S3IS]
    • CHDK
Re: Configurable <alt> button for A620
« Reply #7 on: 03 / March / 2008, 03:24:18 »
By the way, do developers (such as Allbest) release their sources somewhere? I guess I have to do this for every build, yes? (But then it will not take long when I know what to do...)
Yes, there is the SVN-repository.
/trunk - chdk - Trac
Timeline - chdk - Trac
Compiling CHDK under Windows - CHDK Wiki
Compiling CHDK under Linux - CHDK Wiki
CHDK Developer.

Re: Configurable <alt> button for A620
« Reply #8 on: 04 / March / 2008, 16:35:06 »
Hi again!

I couldn't help myself and I've started coding  :P

I've modified gui.c so that this is correct as far as I can tell. After some trial and error I have figured out that I must also modify conf.c, and platform.h.

I have modified platform.h so that the function 'kbd_set_alt_mode_key_mask' is defined for my camera by including my camera in the CAMERA_MULTIPART definition. I have modified conf.c as following:

Code: [Select]
original:
303 static void conf_change_alt_mode_button() {
304 #if defined(CAMERA_s2is) || defined(CAMERA_s3is) || defined(CAMERA_g7)
305     kbd_set_alt_mode_key_mask(conf.alt_mode_button);
306 #else
307     conf.alt_mode_button = KEY_PRINT;
308 #endif
309 }

new version:
303 static void conf_change_alt_mode_button() {
304     kbd_set_alt_mode_key_mask(conf.alt_mode_button);
305 }

But when compiling, this fails and returns:

Code: [Select]
>> Entering to core
gui.c -> gui.o
-> main.elf
gui.o: In function `gui_alt_mode_button_enum':
gui.c:(.text+0x4dc): undefined reference to `kbd_set_alt_mode_key_mask'
gui.o: In function `card_break_proc':
gui.c:(.text+0xaee): undefined reference to `create_partitions'
gui.o: In function `gui_menuproc_swap_patitons':
gui.c:(.text+0xb1a): undefined reference to `get_part_count'
gui.c:(.text+0xb32): undefined reference to `swap_partitions'
conf.o: In function `conf_change_alt_mode_button':
conf.c:(.text+0x13c): undefined reference to `kbd_set_alt_mode_key_mask'
collect2: ld returned 1 exit status
D:\Dokumenter\aasmund\CHDK\gcc\bin\gmake[1]: *** [main.elf] Error 1
gmake: *** [all-recursive] Error 1
:blink:

It seems for every failing function call i fix, four new ones appear. Does anyone have a good idea of what is going on? Is there any documentation from the people who implemented this on the G7 and the S2 / S3? I will spend some more time on it, and I'll let you know if I discover something.

I believe there may also be something in kbd.c that I'm missing... I found some references to conf.alt_mode_button in kbd.c, but as far as I can tell, these just open the menu when the alt button defined in gui.c via conf.c is pressed.

I know this is a lot of code, but a little help would be nice:)

Thank you all very much:)
Aasmund.

Re: Configurable <alt> button for A620
« Reply #9 on: 03 / April / 2009, 22:16:46 »
This is an old thread, but in case anyone is still watching it, I posted a possible solution to a similar problem (with the A570) here:

http://chdk.setepontos.com/index.php/topic,3025.msg31537.html#msg31537

Thanks to the folks who posted to this topic, you pointed me in the right direction and saved me a lot of time.

 

Related Topics


SimplePortal © 2008-2014, SimplePortal