Is there a way to get the key state on mouse click?

events

#1

If the user clicks on the submit button I’d like to check if the shift or ctrl key is down. The last I checked it isn’t available for all events but I thought maybe it would be available on click events.

Test code:

var submitButton = document.createElement("button"); 
// ...
submitButton.addEventListener("click", submitMainForm(event) {
    console.log("Shift:" + event.shiftKey); // always false
}

Use Case:
Mikael is working on a plugin and screen real estate is limited so he is would like to enable a less used feature to be enabled when the user holds down the ctrl or shift key while clicking on a button.