Is there a property on a click event that means ctrl on windows and command on mac?

I’m trying to get if the command key is down in Mac or the CTRL key is down in Windows. Is there an existing property for that on a click event?

you mean keypress event?

In my plugin dialog I have a helper function that adds an outline around the element using something like this:

mainForm.dialog.addEventListener("click", formClickHandler);

formClickHandler(event) {
    var component = event.target;

    if ((event.ctrlKey || event.metaKey) && event.shiftKey==false) {
        // add outline
    }
}

What I have now is (event.ctrlKey || event.metaKey).

I’ve seen somewhere a event.ctrlOrCmd property. I don’t remember where I saw it. I was wanting to know if anything like this existed.

Looks like there is no event that supports that on the browser. Here is a good alternative solution you might want to try: https://stackoverflow.com/questions/3902635/how-does-one-capture-a-macs-command-key-via-javascript

Unfortunately, there is no UXP specific event that supports this