Mouse event function registered by ScreenSpaceEventHandler(cavasElement) won't properly fire when specific keys are being held
Closed this issue · 2 comments
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
Environment
Browser: Chrome
CesiumJS Version: 1.121
Operating System: Windows 11
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
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
orAlt
it's firing a different event handler. See this sandcastle
Cool, thanks!