Wait_click and is_pressed question - General Help and Assistance on using CHDK stable releases - CHDK Forum

Wait_click and is_pressed question

  • 2 Replies
  • 1435 Views
Wait_click and is_pressed question
« on: 12 / August / 2020, 06:38:51 »
Advertisements
I’m sure someone can educate me on the above.

The snippet of code I’m using is this:

Code: [Select]
repeat
    wait_click()
until (is_key("shoot_half") or is_key("shoot_full"))

Clearly, wait_click ‘hyjacks’ the key, ie hides it from the Canon side.

My question is therefore related to is_key, as pressing the half or full shutter passes these keys to the Canon side. Or so I think.

Have I got things right?



Re: Wait_click and is_pressed question
« Reply #1 on: 12 / August / 2020, 10:09:53 »
My question is therefore related to is_key, as pressing the half or full shutter passes these keys to the Canon side. Or so I think.
When CHDK is in <ALT> mode, all key presses are blocked from reaching the Canon firmware, including half and full presses. The script engine runs in <ALT> mode. 

Using full press in a script is a bit tricky as you need to explicitly disable it so that the CHDK script engine does not see it and halt the script.
« Last Edit: 12 / August / 2020, 10:13:25 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Wait_click and is_pressed question
« Reply #2 on: 12 / August / 2020, 10:43:59 »
@waterwingz

I think you confirmed what I thought.

Quote
Using full press in a script is a bit tricky as you need to explicitly disable it so that the CHDK script engine does not see it and halt the script.

In my code snippet I wanted the full shutter press to act as normal, ie terminate the script, but I thought I would need to send a key press.

What happens is the FS does indeed terminate the script, which is what I want :-)

That is the CHDK script engine 'reacts' to it, because, obviously, it's tracking key strokes. But it remains 'hidden' from the Canon side, as does the half shutter press.

Cheers

Garry

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal