hammerjs two finger drag and rotate at the same time - hammer.js

I am having problems dragging and rotating object with two fingers at the same time. I set up a pan listener and rotate listener using recognizeWith feature. Rotate event is fired, but pan event is not. If I put all into one handler, I get 0 deltaX and deltaY. If I configure pan with 1 pointer (default) then pan event is fired normaly.
Can someone please show me how to enable two finger drag and rotate at the same time?

Related

How to webgl detach transform control when click another range not transform control

I'm developing webgl graphics with three.js
While I developing, I'm facing something stuck.
I'm trying to detach transform control when I click another range(ex, grid or another objects) not transform control.
I implemented it by checking clicked position.
For example, I set event handler with mouse down and in there, I store that mouse position. Also I set event handler with mouse up and in there, I compare mouse positions both mouse down and mouse up. If two positions are same, I detach the transform controller. However with this implementation, transform controller was disappeared though I clicked transform controller.
I just wanna detach transform control when I click another position not transform control
Does anyone help me please with this issue?
Thank you in advance.

Intercept ScrollView zoom before it bounces back

I want to receive a callback when a ScrollView's zooming view is scaled below a threshold so that I can dismiss the view controller. I'm currently using the bouncesZoom property which allows the zooming view to be scaled below the minimumZoomScale and snap back when the user ends the gesture.
I considered using scrollViewDidEndZooming with passes me a scale parameter. The problem is that this callback is triggered after the zooming view bounces back to minimumZoomScale. Therefore, the dismissal transition would include the bounce back and that isn't the desired effect.
I considered setting the bouncesZoom to NO when the zoomScale dips below the threshold. But that has the effect of snapping the zooming view instantly to the minimumZoomScale.
I also tried setting the minimumZoomScale to the current zoomScale once it dips below the threshold. This solves the bounce back problem because the zoomScale is now equal to the minimumZoomScale and so the bounce back is imperceptible. This has a visual glitch as well when I make that assignment. I'm not sure it is safe to set the minimumZoomScale to the current zoomScale while zooming. So this approach isn't ideal either.
What can I do to hook into the gesture end event and avoid the bounce back?

three.js - touch events for THREE.RollControls

I've used THREE.RollControls for movements in a scene of tube geometry.
How do I use THREE.RollControls for touch events ?
I would start by taking a look at the code for RollControls. Toward the bottom, you'll see where all the mouse events are bound to their handlers.
To add touch support, you can edit or extend RollControls to respond to touch events. I'd expect the mousemove, mousedown, and mouseup events to correspond to touchmove, touchstart, and touchend events respectively.

Gtk/GtkD Detect release of mouse button on window resize?

I'm trying to improve a plotting library that I wrote with GtkD (the D bindings for Gtk). Scatter plots with a lot of points take a long time to resize. I want to rescale the image, allowing pixelation, while the user is dragging the window edge to resize, and only re-render it when the mouse button is released.
Is there an API to detect whether the user is still holding down the mouse button to drag the window edge when a window is being resized? If you are not familiar with GtkD, a response in terms of the C Gtk API would still be appreciated.
you can add a 500 millisecond timeout to the redraw (resetting the timer on each resize event) this allows a user to see a preview while dragging

gwt mouse over events not fired when mouse button is down

When you push down the left mouse button mouse down event fires. If you then move the mouse over a label (while holding the mouse button down) mouse over event does not fire.
Is there any way to enable this events or fire them manualy or simulate them?
What you are actually doing is two separate events, one is a mouse down event as you have described and the other is a mouse drag.
If you want to simulate them, that you might have to consider using a mouse click to track the user's (x,y) location. Subsequently, if you want to "simulate" it you could do some computation and decide for yourself if it is indeed a mouse click or mouse drag event that has occurred.
Hope it helps :) Cheers!

Resources