You are not logged in.

Search results

Search results 1-2 of 2.

Wednesday, November 18th 2015, 8:04am

Author: dancoder

Get mouse click point before context menu opens

Thanks for the suggestions (and sorry for the late reply). As Tuur suggested I'm using a key event for this. Pressing the 'h' or 'H' key will create a hotspot. I'm also using a double-click event (2 click events within a certain time). Source code 1 2 3 <events name="addHotspotEvent" onclick="js(panoramaClicked())" onkeyup="js(panoramaKeyed())" /> Source code 1 2 3 4 5 6 7 8 9 10 function panoramaKeyed(args) { var krpano = document.getElementById("krpanoViewer"); if (window.canAddHotspot) { var ...

Sunday, October 4th 2015, 9:59am

Author: dancoder

Get mouse click point before context menu opens

Hi. I use the HTML5 viewer (krpano 1.18.5) and have a context menu option for adding a hotspot. Source code 1 2 3 <contextmenu> <item name="addHotspotMenuItem" caption="Add hotspot" onclick="js(createHotspot())"/> </contextmenu> In my JavaScript file I have a function to handle the hotspot creation. Source code 1 2 3 4 5 6 7 8 9 function createHotspot() { var krpano = document.getElementById("krpanoViewer"); var mx = krpano.get("mouse.x"); var my = krpano.get("mouse.y"); var pt = krpano.screento...