detecting multiple click - Script Writing - CHDK Forum  

detecting multiple click

  • 1 Replies
  • 1803 Views
detecting multiple click
« on: 02 / January / 2009, 10:17:37 »
Advertisements
Hi!

I planned to add a multiple function to my remote control by certain numbers of clicks in a short period of time, eg
1 click - take a photo
2 clicks - zoom in
3 clicks - zoom out

But I have a problem how to detect how many times was a remote button clicked.
Can somebody help me somehow?  :-X

*

Offline zeno

  • *****
  • 889
Re: detecting multiple click
« Reply #1 on: 02 / January / 2009, 11:21:24 »
Most of the devices that provide multiple signals (e.g. the GentLED CHDK, the Apple Remote etc) don't use multiple clicks, but instead vary the time power is applied. Since get_usb_power returns this value, it's very easy to write a script which does different things depending on the length of the power pulse.

Of course, it's not so easy to use a simple switch and time it yourself, better to have a bit of electronics to do it for you. But it wouldn't be hard to write a script that took a photo if the switch was pressed for less than a second, zoomed in for a pulse of between 1 and 2 seconds and zoomed out for one that was over two seconds. 
A570, S100, Ixus 127
Author of ASSIST, STICK, WASP, ACID, SDMInst, LICKS, WICKS, MacBoot, UBDB, CFGEdit

 

Related Topics