|
|
|
|
|
by chrismorgan
1492 days ago
|
|
The middle mouse button doesn’t trigger a click event, but rather auxclick (like right click also doesn’t, but rather contextmenu and then auxclick if that’s preventDefaulted). But there are definitely situations where it’s judicious to check event.button, and I missed altKey, too. Here’s the full function Fastmail uses: const isClickModified = function (event) {
return (
!!event.button ||
event.altKey ||
event.ctrlKey ||
event.metaKey ||
event.shiftKey
);
};
|
|
On a side note, I can't believe we still don't have a `visit` or `activate` event that works regardless of hardware, without having to exclude modifier keys.