These are chat archives for openseadragon/openseadragon

27th
Oct 2015
Grant Echols
@gechols
Oct 27 2015 17:07
I'm comparing the number of 'canvas-scroll' events that happen on my mac - I get almost double the number of events when I use the two finger scroll gesture on the track pad as when I use the scroll button on the mouse. Any idea why that would be happening? It makes the mac track pad zoom and scroll too sensitive to use effectively.
Ian Gilman
@iangilman
Oct 27 2015 17:10
@gechols Yes! The state of scroll wheel events in the browser is terrible. Here is the issue: openseadragon/openseadragon#470
If you can figure out a way through the mess, I would be delighted!
VoidVolker
@VoidVolker
Oct 27 2015 17:22
need to add filter
Ian Gilman
@iangilman
Oct 27 2015 17:23
Indeed. It's just hard to detect what is what.
VoidVolker
@VoidVolker
Oct 27 2015 17:24
I don't have mac, but have laptop with win
  1. need to find differences between trackpad events and mouse events
Ian Gilman
@iangilman
Oct 27 2015 17:25
Last I looked, the browser doesn't give us much to go on. It's possible that's changed since then...
VoidVolker
@VoidVolker
Oct 27 2015 17:25
on touch screen it simple: just add own filter to touch and global var with touch state and check it var on scroll
Ian Gilman
@iangilman
Oct 27 2015 17:26
Yup
VoidVolker
@VoidVolker
Oct 27 2015 17:26
need to find what events can generate touchpad
may be it generate touch events
if so - then solution is above
Ian Gilman
@iangilman
Oct 27 2015 17:26
Hmm...I don't think so but worth looking into!
VoidVolker
@VoidVolker
Oct 27 2015 17:27
may be I will check my laptop later touchpad
Ian Gilman
@iangilman
Oct 27 2015 17:27
Right on :)
VoidVolker
@VoidVolker
Oct 27 2015 17:27
if events from touch pad 1f, 2f and from mouse are same - then need calibration tool
if it detect too big speed it will ask user if it comfortable speed ot he want to make it slower and he have touchpad -> then, we create some constant animated circle for 1 touch and user follow with finger to this circle (1-2 times)
then same for 2 fingers
we need collect difference between 1 finger events generation speed and 2 finger events generation speed
but, it not perfect
if user want very fast 1 finger scroll - what then?
Ian Gilman
@iangilman
Oct 27 2015 17:32
Yeah, I think ideally we wouldn't need a calibration, but it's enough of an issue maybe we should contemplate it
VoidVolker
@VoidVolker
Oct 27 2015 17:33
o! may be, browser have some maximum events speed for one touch and for 2 touches time between events will be shorter, then, we can drop some events
also, if scroll events have x and y - then it will be better
we can connect traectory for each x - x1 - x2 -x3
usually scroll is line - and if we have not line - it is 2 fingers
Ian Gilman
@iangilman
Oct 27 2015 17:38
That all depends on whether we get touch events for track pad, which I don't think we do
Anyway, all good thoughts!
@gechols Lots of food for thought ^
Grant Echols
@gechols
Oct 27 2015 17:50
So here's a total hack (that happens to work for my code)...Since the track pad is firing nearly 2 or 3 times as many canvas scroll events I just decided to keep a timer and throw away any scroll events that happen faster than 3 milliseconds. Its enough for the present time... nasty, but effective.
Ian Gilman
@iangilman
Oct 27 2015 17:51
Well, it's better than anything we've come up with so far...might be worth adding something like that to OSD
VoidVolker
@VoidVolker
Oct 27 2015 17:57
@gechols cool, as I thought - filter them by time )
Grant Echols
@gechols
Oct 27 2015 18:00
Well - desperation is the mother of hacks...or something like that ;-)
Ian Gilman
@iangilman
Oct 27 2015 18:01
:)
Mark Salsbery
@msalsbery
Oct 27 2015 18:09
Indeed, that’s a pretty good solution! There’s no standardization with that event so it’s always a tough one for sure.
Ian Gilman
@iangilman
Oct 27 2015 18:10
@gechols Would you mind making a patch for OSD?
VoidVolker
@VoidVolker
Oct 27 2015 18:11
hey, I opened for me coffee script xD
I like it for now )
Grant Echols
@gechols
Oct 27 2015 19:09
@iangilman I didn't make any changes to OSD so there's really no patch to make. I guess we could change the pace of the code 'generating' the 'canvas-scroll' event, but I just added the pace checking to my listener. Is it something others are struggling with too?
Ian Gilman
@iangilman
Oct 27 2015 19:10
Absolutely! Lots of people have complained...check out #470
So yeah, adding the filtering when we generate the event seems like a decent approach
Grant Echols
@gechols
Oct 27 2015 19:12
OK - I'll make a configurable # of milliseconds then - with the default set to 3. Sound OK?
Grant Echols
@gechols
Oct 27 2015 20:02
See: openseadragon/openseadragon#754 for the scroll speed patch
Mark Salsbery
@msalsbery
Oct 27 2015 20:20
Nice! Can we change the setting name so it implies time/ms? :)
Ian Gilman
@iangilman
Oct 27 2015 20:24
@gechols Awesome, I'll take a look. @msalsbery good thought.
Grant Echols
@gechols
Oct 27 2015 21:34
Updated config parameter with 'MS' to suggest milliseconds
Ian Gilman
@iangilman
Oct 27 2015 21:35
Cool :)
Mark Salsbery
@msalsbery
Oct 27 2015 22:30
Thank you @gechols !!