import { isMac } from "../../../lib/client";
import { isThemeGTE } from "../../../lib/theming/ThemeHelpers";
var keyDescription = null;
var getKeyDescription = function getKeyDescription(theme) {
  return keyDescription || (keyDescription = createKeyDescription(theme));
};
var createKeyDescription = function createKeyDescription(theme) {
  return isMac ? {
    name: isThemeGTE(theme, '5.3') ? '⌥' : 'Alt',
    checkPressed: function checkPressed(event) {
      return event.altKey;
    }
  } : {
    name: 'Ctrl',
    checkPressed: function checkPressed(event) {
      return event.ctrlKey;
    }
  };
};
export var getKeyName = function getKeyName(t) {
  return getKeyDescription(t).name;
};
export var checkKeyPressed = function checkKeyPressed(event, theme) {
  return getKeyDescription(theme).checkPressed(event);
};