When working with deck.gl's IconLayer
, I want to be able to listen for shift-clicks on icons. The goal is to enable multiple icon selections by holding down the shift key. My setup involves using deck.gl in conjunction with Google Maps.
Upon clicking on an icon within the (Icon)Layer
, the onClick
event should provide access to both info
and event
. However, despite looking into the MouseEvent
contained in event.srcEvent.wa
, the shiftKey
property consistently returns as false
, regardless of the actual state of the shift key.
new IconLayer({
onClick: (info, event) => {
console.log(
`The shift key was ${event.srcEvent.wa.shiftKey ? '' : 'not '}pressed`,
);
},
});
Initially, I anticipated that the shiftKey
property would accurately reflect whether the shift key was being pressed or not. However, the slightly peculiar wa
property and the lack of documentation surrounding the entire event
object have added some confusion to the situation.