Canon G16 Iso and front wheel buttons name for use on scripts - General Discussion and Assistance - CHDK Forum

Canon G16 Iso and front wheel buttons name for use on scripts

  • 3 Replies
  • 2714 Views
Canon G16 Iso and front wheel buttons name for use on scripts
« on: 27 / September / 2021, 06:41:34 »
Advertisements
Hello!
My name it's Oier and I found this website looking for a solution for my problem.
I have two underwater manual flashes and I want to shoot on manual mode with my canon G16. Unfortunately, the underwater case doesn't have front wheel and rear wheel buttons.
I have been looking on this web and I found partial solution for this inconvenience. Using script, I can modificate values with left and right key. Now, I want to go far away and try to "click Iso button" for change between Av,TV and Iso Values using "down" key.
Unfortunately script doesn't recognize "iso" or "erase" (both are sema button on G16) as valid button name.
And finally, the question it's:
Somebody knows the name for iso/erase button or front wheel, for try to use it on scripts?
Thanks in advance and congratulations for this project. It's amazing and save me money from purchase expensive and obsolete underwater case!

*

Offline Caefix

  • *****
  • 947
  • Sorry, busy deleting test shots...
Re: Canon G16 Iso and front wheel buttons name for use on scripts
« Reply #1 on: 27 / September / 2021, 11:45:16 »
Reading .../platform/g16/kbd.c
Quote
    { 0, KEY_PRINT           ,0x00002000 }, // G16 shortcut key
    { 0, KEY_ERASE           ,0x00001000 }, // G16 erase or ISO key
    { 0, KEY_AE_LOCK         ,0x00000800 }, // G16 * or AE Lock
    { 0, KEY_WIFI            ,0x00000400 }, // G16 WiFI or AF frame select
I would expect to work:
Code: [Select]
if is_pressed ("erase") then press ("erase"); sleep(100)
...
 end
or You call something like  :-[
Code: [Select]
function exitalt(x,...)
 if x then play_sound(x%7); print(...) end
 set_aelock(0); set_aflock(0)
 repeat exit_alt(); sleep(333) until get_alt_mode();
 wait_click(22)
 play_sound(2)
end
 
if is_pressed ("wifi") then exitalt(0)
   ...
end
to adjust values as usual without script until You press the defined <ALT>key, (<play> by default) to return to script...
« Last Edit: 27 / September / 2021, 12:26:14 by Caefix »
All lifetime is a loan from eternity.

*

Offline reyalp

  • ******
  • 14117
Re: Canon G16 Iso and front wheel buttons name for use on scripts
« Reply #2 on: 27 / September / 2021, 15:53:39 »
Somebody knows the name for iso/erase button or front wheel, for try to use it on scripts?
As Caefix said, it should recognize 'erase'. If press('erase') or click('erase') doesn't work, there could be a bug in the port and some additional testing would be helpful.

The ubtest.bas script CHDK/SCRIPTS/TEST has an example that prints the name of each key pressed. Note it doesn't currently include every possible key defined in CHDK, but it erase is there.

For the front wheel, you might be able to use logical events with post_levent_to_ui. However, I'm not certain what the event names for this dial would be. I've attached a list of levents defined for G16. The name would likely include "Rotate" or "Dial"

Note you can can also use levents to generate key presses, which would be an option if you can't get erase to work, but if there's a bug in the CHDK key mapping I'd like to fix it.
Don't forget what the H stands for.

Re: Canon G16 Iso and front wheel buttons name for use on scripts
« Reply #3 on: 27 / September / 2021, 16:41:14 »
God Save This Forum!!! Special thanks to reyalp and Caefix for they rapid and correct answers!!
It´s works. Yes, i am the king of Copy-Paste :P and i did it with spcecial lua script that i have found for wheel buttons. Unfortunaly i wrote bad the sintaxis for "erase" button  :o
It´s the first scrip that i made, sorry, its not correct, customize on my live!!  :D :D
I am very happy with this solution. Thank to all!!!
Let me paste de script for someone else:

--[[
@title Underwater Case
@chdk_version 1.5.1
]]
while true do
   wait_click(1000)
   if is_key'set' then
       break
   elseif is_key'left' then
      wheel_left()
   elseif is_key'right' then
      wheel_right()
   elseif is_key'down' then
      click ("erase")
   end
end


 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal