Reputation: 1
I'm trying to change the keys of OpenSeadragon, the default is left button and long press to drag the picture, I want to change it to right button long press and drag, what should I do, below is the code I tried, but it doesn't seem to work effect
<script>
var mouse = OpenSeadragon.Button({
element:'view',
});
mouse.isTracking(true)
mouse.dragHandler(function (event){
event.buttons = 0
});
});
</script>
Upvotes: 0
Views: 156
Reputation: 2174
There's no simple "switch drag to the right mouse button" feature in OSD, but it's possible you could implement it. You'll have to disable the viewer.innerTracker.dragHandler
by setting it to null, and then create new functions for these three handlers:
You'll need to implement your own drag functionality, since OSD doesn't have a "non-primary drag" handler. As for the actual panning functionality, you can take a look at how it currently does it with the left mouse drag.
Upvotes: 0