Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mouse event function registered by ScreenSpaceEventHandler(cavasElement) won't properly fire when specific keys are being held #12235

Closed
Ron025 opened this issue Oct 6, 2024 · 2 comments

Comments

@Ron025
Copy link

Ron025 commented Oct 6, 2024

What happened?

As simple as the title tells.

This issue does not happer if you switch to cavasElement.addEventListener('mousedown', function(e){ ... }) instead.

Or, suspension on these keys are on purpose ?

Reproduction steps

1 Register mouse event such as left_click, left_down or left_up using ScreenSpaceEventHandler(canvasElement).setInputAction()

2 Press down and hold any key of Ctrl, Shift or Alt

3 Click mouse's left button on map, the registered function won't be fired.

Sandcastle example

https://sandcastle.cesium.com/#c=dY9Ba8MwDIX/ismlCRSbnpeGja5jg7IeUraLYbiOupk5crDllGzsv89JL2VrdZKe3veEtMNArDdwBM+WDOHIVhBMbPnLpOUy09O8ckjKIHiZFTcSJZ5Za+0BsO6UhnUPSI8KG5vYUywPGhC4VtirUPAA9IRdpDtNxmF+iDg1LIcRLdh3CieVcMpni1kh8Wd+7c5u6IBv1g+7t/vt63ORzbMy0GChksimujVt5zyx6G3OuSBoO6sIgthH/QnEdQjjM6O1FOdo2ZiemWZ54XumrQohbQ7R2tp8gcyqUiT/P9Q61Rh83/bgrRpG28ei2pxEznkp0niZJOfsXvk/yb8

Environment

Browser: Chrome
CesiumJS Version: 1.121
Operating System: Windows 11

@jjspace
Copy link
Contributor

jjspace commented Oct 7, 2024

This is by design. The event handlers require you to specify what modifiers need to be held down for an action and only trigger that handler when fired. When you hold Ctrl, Shift or Alt it's firing a different event handler. See this sandcastle

@Ron025
Copy link
Author

Ron025 commented Oct 8, 2024

This is by design. The event handlers require you to specify what modifiers need to be held down for an action and only trigger that handler when fired. When you hold Ctrl, Shift or Alt it's firing a different event handler. See this sandcastle

Cool, thanks!

@Ron025 Ron025 closed this as completed Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants