ScreenSpaceEventHandler priority issue during MOUSE_MOVE

Hi.
I’m able to set several ScreenSpaceEventHandlers. They work as expected individually.

However during MOUSE_MOVE is active, I can’t fire other events, specificially RIGHT_DOWN.

I pick a billboard with LEFT_DOWN, during MOUSE_MOVE I move the billboard on the map. During that movement, in case ‘RIGHT_DOWN’ (or click) event happens, I want to teleport the marker to its initial position (or just console.log some stuff). However if MOUSE_MOVE is active, RIGHT_DOWN is not triggered. It is as if MOUSE_MOVE is higher priority than other events and other events are queued during MOUSE_MOVE is active.

Is there a way to detect RIGHT_DOWN during MOUSE_MOVE?

Hi @yunusyurtturk ,
Thanks for you post.
I do not know of anything preventing RIGHT_DOWN from firing while MOUSE_MOVE is also firing in CesiumJS.
I made a simple sandcastle example to double check. Cesium Sandcastle

You said you set multiple ScreenSpaceEventHandlers

I believe it is best practice to set just one ScreenSpaceEventHandler for a scene and then set up as many event handlers as you need on that one instance using setInputAction. This is also demo’d in the attached sandcastle linked above.
Do you think you could give that a try? Please let me know if the problem persists.
Thanks,
Luke

Hi @Luke_McKinstry
Thanks for trying my problem. After trying your example, I realized my description of problem is missing.

In my case, I pick an entity by left clicking and holding my mouse, and moving the entity marker around the map. When ‘pick’ is started, I disable “rotate and translate events” of the camera controller so that I can move the entity instead of rotating the world:

screenSpaceCameraController.enableRotate = false
screenSpaceCameraController.enableTranslate = false;

I need to fire ‘RIGHT_DOWN’ event during this drag operation, when left mouse is still pressed. This is the case that doesn’t work.

Luckly, I think the problem reproducable in the example you provided. Just rotate the world and during rotation (while your left mouse is still pressed), click right mouse button. The right event log doesn’t appear.
In stationary case when you right click on the globe, RIGHT_DOWN event logs appear. I think this behaviour is similar to my problem and simpler to reproduce.

Hi @yunusyurtturk ,
Thank you for clarifying.

I do think there is are limitations making it not possible to implement the specific steps you outlined.

Could you possibly achieve a similar UX by using left click to begin the move action and right click to complete it? This is a common pattern used for drawing on the cesium globe, like in this sandcastle example Cesium Sandcastle

I hope that is helpful and please feel free to post again for more help or possible alternatives.
Thanks,
Luke

Hi @Luke_McKinstry , thanks for the suggestion. In my case&opinion, that wouldn’t be a good UX practise, I will go with my own way:
I added a Javascript keydown event that whenever ESC is pressed, it interrupts my MOUSE_MOVE (drag) event.

document.addEventListener('keydown', function(event) {
    if (event.key === 'Escape' || event.keyCode === 27) {
        drag.interruptMove()
    }
});

The downside is, you need at least 1 more MOUSE_MOVE event to be triggered in order to catch the interrupt.