merge isMetaKey and isMetaClick utility functions

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

  • Close this issue

These functions are a lot similar:

  gl.utils.isMetaKey = function(e) {
    return e.metaKey || e.ctrlKey || e.altKey || e.shiftKey;
  };

  gl.utils.isMetaClick = function(e) {
    // Identify following special clicks
    // 1) Cmd + Click on Mac (e.metaKey)
    // 2) Ctrl + Click on PC (e.ctrlKey)
    // 3) Middle-click or Mouse Wheel Click (e.which is 2)
    return e.metaKey || e.ctrlKey || e.which === 2;
  };

We could either merge them or improve their names.

Edited Sep 29, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading