wait_click(0) error? - General Discussion and Assistance - CHDK Forum

wait_click(0) error?

  • 7 Replies
  • 5114 Views
*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
wait_click(0) error?
« on: 01 / May / 2011, 15:38:37 »
Advertisements
I think there is an error in code for script command wait_click(0).

This code works:
Code: (lua) [Select]
print(1)
wait_click(10000)
print(2)

This code works not:
Code: (lua) [Select]
print(1)
wait_click(0)
print(2)

The second script should be wait for any key click, but wait_click(0) is ignored. The same with uBasic. I've tested with the recent version of CHDK (rev. 1165) and CHDK-DE (rev. 652).

It is very important to solve this problem. Many scripts in our script collection (German CHDK forum) use this command.

msl
CHDK-DE:  CHDK-DE links

*

Offline reyalp

  • ******
  • 14126
Re: wait_click(0) error?
« Reply #1 on: 01 / May / 2011, 15:59:36 »
Has been this way for a long time I think, but I agree it would make more sense to wait indefinitely if number is 0 or not given. See also http://chdk.setepontos.com/index.php?topic=6315.msg65108#msg65108
Don't forget what the H stands for.

*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: wait_click(0) error?
« Reply #2 on: 02 / May / 2011, 05:03:36 »
Long time?  :)

The cause you can find in changeset 1101 (CHDK) or in 608 (CHDK-DE).

With this change works again all fine.

msl
CHDK-DE:  CHDK-DE links

*

Offline reyalp

  • ******
  • 14126
Re: wait_click(0) error?
« Reply #3 on: 02 / May / 2011, 13:00:27 »
Oh my mistake. Thanks for that, will add to CHDK as soon as I get the chance. Or you can add it :)
Don't forget what the H stands for.

*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: wait_click(0) error?
« Reply #4 on: 02 / May / 2011, 14:45:44 »
Or you can add it
Yes, of course. I will do it tomorrow. At the moment I have no SVN environment.

msl
CHDK-DE:  CHDK-DE links

*

Offline reyalp

  • ******
  • 14126
Re: wait_click(0) error?
« Reply #5 on: 02 / May / 2011, 23:37:54 »
Don't forget what the H stands for.

*

Offline reyalp

  • ******
  • 14126
Re: wait_click(0) error?
« Reply #6 on: 04 / May / 2011, 00:08:17 »
It seems there is a small bug with this. conf.script_shoot_delay may be zero, then shoot() function will wait forever. Reported in http://chdk.setepontos.com/index.php?topic=2361.msg65994#msg65994

Workaround in changeset 1170 (chdk) / changeset 655 (chdkde)

Maybe it would be better to use -1 as the wait forever value, at least internally.
Don't forget what the H stands for.

*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: wait_click(0) error?
« Reply #7 on: 04 / May / 2011, 03:26:25 »
Thanks for commit in CHDK-DE. 

Maybe it would be better to use -1 as the wait forever value, at least internally.
I agree.

msl
CHDK-DE:  CHDK-DE links

 

Related Topics


SimplePortal © 2008-2014, SimplePortal