How to pass in mouse drag event from external javascript call?

  • Is there a way to pass in a mouse drag event to krpano from an external javascript function? (I know there is no such "drag" event in javascript, but rather a sequence of mouse events that results in a drag).

    What I am trying to do is when my external javascript detects a mousedown event on a div in my html, I'd like to "pass" that event into krpano, so that subsequent mouse movement pans the view. So, click on my floating div, and as long as no mouseup event fires, immediately start panning the krpano view with any mouse movement, just like you would if you were to click and drag directly in the krpano tour. On mouseup, stop panning, and "return control" to my html's javascript events.

    For illustration purposes, bring up any google street view scene, and hover over an area that results in the cursor changing to an arrow. If you click the mouse then, you go to the linked scene. But, if you click mouse down, and leave it down, you can then pan the view, effectively cancelling the move to the next scene.

    This may be more a javascript question than a krpano question, and I'll post elsewhere if it is, but if there is a way to externally hook into the mouse pan "event" in krpano, that would do the trick.

    Note: I have tried setting my div's css property "pointer-events" to none once mousedown is triggered, and that works, but only on subsequent mousedown events does the drag event pass through to krpano. I cannot figure out how I can tell krpano that subsequent mouse movements should result in panning of view, when the initial mousedown happened in external element. Maybe this is not even possible, and I'll have to re-evaluate what I'm doing.

    Thank you!

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!