# ScreenSpaceEventType right double click not working

**URL:** <https://community.cesium.com/t/screenspaceeventtype-right-double-click-not-working/2338>\
**Category:** CesiumJS\
**Created:** [April 13, 2015, 1:13pm UTC](https://community.cesium.com/t/screenspaceeventtype-right-double-click-not-working/2338 "2015-04-13T13:13:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raghavendra\_Burgala](https://avatars.discourse-cdn.com/v4/letter/r/90db22/32.png) [@Raghavendra\_Burgala](https://community.cesium.com/u/Raghavendra_Burgala)\
**Post date:** [April 13, 2015, 1:13pm UTC](https://community.cesium.com/t/screenspaceeventtype-right-double-click-not-working/2338/1 "2015-04-13T13:13:49Z")

</div>

Hi Cesium Team,

I have a requirement to use mouse right double click.. used the following code to get it.. but its not getting fired.

var viewer = new Cesium.Viewer('cesiumContainer');  
var scene = viewer.scene;  
var mouseHandler = new Cesium.ScreenSpaceEventHandler(scene.canvas);  
mouseHandler.setInputAction( function(movement){  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;console.log('right double click');  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},Cesium.ScreenSpaceEventType.RIGHT\_DOUBLE\_CLICK);

Please help me on this.

Thanks,  
Raghu.

---

<div class="post-metadata">

**Author:** ![Matt\_Amato](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/matt_amato/32/1993_2.png) [@Matt\_Amato](https://community.cesium.com/u/Matt_Amato)\
**Post date:** [April 13, 2015, 1:57pm UTC](https://community.cesium.com/t/screenspaceeventtype-right-double-click-not-working/2338/2 "2015-04-13T13:57:02Z")

</div>

It looks like RIGHT\_DOUBLE\_CLICK has never worked. This is because the browser is never actually sending the double click event, so Cesium has no way to know it happened. A quick search looks like this is an issue in all browsers (and not just with Cesium).

I would recommend just implementing a right double click even yourself, using standard browser events. Listen for the right single click events and compare the time between 2 right clicks to detect double clicks.

I’ll write up an issue so we can look at this in Cesium, but we’ve also talked about deprecating ScreenSpaceEventHandler completely and telling everyone to just use standard browser events.

---

<div class="post-metadata">

**Author:** ![Raghavendra\_Burgala](https://avatars.discourse-cdn.com/v4/letter/r/90db22/32.png) [@Raghavendra\_Burgala](https://community.cesium.com/u/Raghavendra_Burgala)\
**Post date:** [April 15, 2015, 12:57pm UTC](https://community.cesium.com/t/screenspaceeventtype-right-double-click-not-working/2338/3 "2015-04-15T12:57:35Z")

</div>

Thanks Matthew for your reply. Will try your suggestion. And one question from your answer.  
"about deprecating ScreenSpaceEventHandler completely and telling everyone to just use standard browser events."

As we used ScreenSpaceEventHandler in many cases.. so if it deprecates what would be the alternative for this..? and if we use standard browser events how do we get picked objects ..?

var mouseHandler = new Cesium.ScreenSpaceEventHandler(scene.canvas);  
mouseHandler.setInputAction( function(movement){  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var pickedObject = scene.pick(movement.position); // can i get this 'position' from standared event object..?  
},Cesium.ScreenSpaceEventType.LEFT\_CLICK);

---

<div class="post-metadata">

**Author:** ![Matt\_Amato](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/matt_amato/32/1993_2.png) [@Matt\_Amato](https://community.cesium.com/u/Matt_Amato)\
**Post date:** [April 15, 2015, 1:29pm UTC](https://community.cesium.com/t/screenspaceeventtype-right-double-click-not-working/2338/4 "2015-04-15T13:29:10Z")

</div>

The standard events do everything you need, so your code would just be written as:

scene.canvas.addEventListener(‘click’, function(e){

var pickedObject = scene.pick(new Cesium.Cartesian2(e.clientX, e.clientY));

}, false);

That being said, the best solution for an application is to probably use something like [jQuery Ponter Events Polyfill](https://github.com/jquery/PEP) which will give you a unified interface that will work across all input types and devices. The only reason Cesium doesn’t do this is because we can’t do anything that will alter the global scope.

---

<div class="post-metadata">

**Author:** ![Raghavendra\_Burgala](https://avatars.discourse-cdn.com/v4/letter/r/90db22/32.png) [@Raghavendra\_Burgala](https://community.cesium.com/u/Raghavendra_Burgala)\
**Post date:** [April 15, 2015, 2:47pm UTC](https://community.cesium.com/t/screenspaceeventtype-right-double-click-not-working/2338/5 "2015-04-15T14:47:06Z")

</div>

Thanks Matthew.. 🙂
