Mac Command Key not included in diagram's .lastInput

Wiring up the “ObjectSingleClicked” event to detect clicks on my nodes and links and route to my handler:

.addDiagramListener("ObjectSingleClicked", (e) => ...

I’m seeing an issue within my handler on a Mac.

What I want to detect is a control or a command/meta click. My handler does get called when I command click or regular click. When I command click, if inspect the values within theDiagram.lastInput while inside the handler, I see that:

  1. the originating MouseEvent’s metaKey is false, as is its ctrlKey.
  2. lastInput’s values of .meta and .control are false
  3. lastInput’s count of modifiers is 0

Should I be seeing other values when command-clicking on a Mac? How should I go about detecting a command click on a Part?

Thanks,

KW

I see what happened.

Chrome is lazy loading the .lastInput object, so when I inspect it, I’m seeing an unrelated event.

And I am supposed to be checking for .meta (vs. .control), although I should be checking for both since we are targeting all systems.

Cheers,

Kris

Yes, our sample code often checks for e.control || e.meta.

Thanks Walter.