any way to detect key_hold? - Script Writing - CHDK Forum supplierdeeply

any way to detect key_hold?

  • 3 Replies
  • 2286 Views
any way to detect key_hold?
« on: 12 / June / 2011, 20:35:29 »
Advertisements
I would like to modify the video_zoom script for my SX1, I'm allowed to have zoom and MF with original firmware, but the MF is adjusted with the scroll wheel and on SX1 it doesn't give feedback and anyway rotating that forces me to shake with the camera. So I deleted most of the features of the video_zoom script and now when I run it on "in" and "out" buttons changes focus. So now I record movie and when I want to adjust MF i hit ALT button, the script will continue and override the function of the original zoom_in and zoom_out buttons, but whole time I need to push it and release it, push it and release it and I would like to hold it, like you do with zoom. Is there any other way to detect the button presses (and holds) than the is_key etc....?

Thank you for any advice. Anton.

*

Offline reyalp

  • ******
  • 14110
Re: any way to detect key_hold?
« Reply #1 on: 12 / June / 2011, 20:52:14 »
try is_pressed "key", with a while loop.
Don't forget what the H stands for.

Re: any way to detect key_hold?
« Reply #2 on: 13 / June / 2011, 08:58:47 »
try is_pressed "key", with a while loop.

From the basic manual I understand that the is_pressed "key" is just combination of wait_key and is_key, or not?

*

Offline reyalp

  • ******
  • 14110
Re: any way to detect key_hold?
« Reply #3 on: 13 / June / 2011, 13:17:33 »
try is_pressed "key", with a while loop.

From the basic manual I understand that the is_pressed "key" is just combination of wait_key and is_key, or not?
No, it should immediately return whether that key is currently pressed.
Don't forget what the H stands for.


 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal