04-19-2012, 04:04 PM | #1 |
THE NOOB
Posts: 701
Karma: 1545649
Join Date: Jan 2012
Location: Italy
Device: Kindle Touch 5.3.2
|
Javascript double click
Good evening to all!
I'm working on a WAF (Image Gallery) and I need to use the ondblclick event to catch a double click. It seems that Kindle Touch can't use it! I could simulate the double tap using onclick and a time delay, but it isn't a good solution as I always get that delay and it isn't funny. In the WAF's config.xml I found this: Code:
<param name="multi_tap" value="yes"/> Is there a way to catch that event? Thanks a lot!!! |
04-19-2012, 04:41 PM | #2 |
but forgot what it's like
Posts: 741
Karma: 2345678
Join Date: Dec 2011
Location: north (by northwest)
Device: Kindle Touch
|
I've tried to use dblclick event, but for Pillow stuff. Anyway, Pillow and WAF are backed by the same system-wide WebKit library, so my experience could be possibly applied for your case.
So, in my experiments, double tap should've been made VERY fast to produce dblclick event. No, really, VERY FAST. (And with dblclick, click event was also produced.) |
Advert | |
|
04-19-2012, 04:56 PM | #3 |
THE NOOB
Posts: 701
Karma: 1545649
Join Date: Jan 2012
Location: Italy
Device: Kindle Touch 5.3.2
|
Really so fast???
I was tapping at 100 Hz!! I already managed the two onclick events produced by doubleclick, but I couldn't get the Kindle to catch the double click! I tried a different way, but ondblclick still remains the better thing to do! I'll try it again and let you know! |
04-19-2012, 05:04 PM | #4 |
but forgot what it's like
Posts: 741
Karma: 2345678
Join Date: Dec 2011
Location: north (by northwest)
Device: Kindle Touch
|
100 Hz is fast enough so maybe Pillow app can catch dblclick but WAF app can't...
|
04-19-2012, 05:30 PM | #5 |
THE NOOB
Posts: 701
Karma: 1545649
Join Date: Jan 2012
Location: Italy
Device: Kindle Touch 5.3.2
|
I tried it again, but no luck!
I came to manage the double click with onclick and timedelay, using an if condition so that I don't get the delay every time! It works, by now....but definitely not elegant! |
Advert | |
|
04-20-2012, 08:49 AM | #6 |
n00b
Posts: 58
Karma: 2802
Join Date: Jan 2012
Device: Kindle Touch
|
"multi_tap" may stand for "tap with more than 1 finger"
|
04-20-2012, 09:46 AM | #7 |
THE NOOB
Posts: 701
Karma: 1545649
Join Date: Jan 2012
Location: Italy
Device: Kindle Touch 5.3.2
|
I think the multi-tap it's actually just like the double-click.
2 fingers should be managed by: Code:
<param name="pinchzoom" value="yes" properties="fire-on-zoom:1"/> Last edited by silver18; 05-06-2012 at 12:20 PM. |
04-20-2012, 11:56 AM | #8 |
hub
Posts: 715
Karma: 2151032
Join Date: Jan 2012
Location: Iranian in Canada
Device: K3G, DXG, Kobo mini
|
Somehow related to your question:
Is there any way to make dictionary work in browser (Kindle Touch)? select a word by touching and showing the menu as in the ebook reader. Spoiler:
|
05-06-2012, 12:26 PM | #9 |
THE NOOB
Posts: 701
Karma: 1545649
Join Date: Jan 2012
Location: Italy
Device: Kindle Touch 5.3.2
|
Here's how I fixed this problem:
Code:
var doubleclicks = 0; var timer; function doubleClick () { doubleclicks = 0; clearTimeout(timer); ENTER WHAT DO YOU WANT TO DO HERE } function simulateDoubleClick () { doubleclicks = doubleclicks + 1; if (timer) clearTimeout(timer); timer = setTimeout(function() { singleClick (); }, 550); if (doubleclicks == 2) { doubleClick (); } } function singleClick() { ENTER WHAT DO YOU WANT TO DO HERE } Code:
onClick="simulateDoubleClick ()" |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Turn Off Double Click to Edit | BetterRed | Calibre | 2 | 03-28-2012 05:34 AM |
interface tweak - can I customise double click ? | cybmole | Calibre | 8 | 09-29-2011 01:35 AM |
Kindle 3 Page-turn button noise: Click or no click? | samonakuba | Amazon Kindle | 12 | 07-25-2011 05:21 PM |
double click | mfaine | Calibre | 1 | 11-09-2009 10:56 AM |
Anti- 1-click buy settings. 1-click is security risk? Need support from community | med007 | Amazon Kindle | 14 | 07-30-2009 12:37 AM |