I’ve been doing a daily quil
sketch for a few days now, after some time away from programming.
In the last sketch (http://vaguery.com/words/quil-for-20200208) I activated :navigation-2d
middleware, but discovered (again, I think, since I recall this from some time back) that using my trackpad and touch events anywhere in the document are registered by the sketch. In the linked example, the text in the blog post means you’ll probably have scrolled down to see the sketch, and unless you are an obsessive scroll-thumb person that means you’ll be zooming.
I’ve been wrestling with the API docs this evening trying to find a way of managing focus, so that only drags and gestures within the sketch are registered. But I haven’t yet found anything to filter events by focus (I know it’s not supported in cljs), or examples of how to filter by target.
Any hints greatly appreciated.
I’m starting to think that the surround div
will need to be instrumented, and somehow pass state down into the quil sketch via arguments to draw-state
. That way, the problem of focus, mouse-entering (which doesn’t seem to be triggering in 3.1?), and most of all browser zoom level might be something I can get a grip on.
¯\(ツ)/¯