import { useState as i, useEffect as u } from "react";
function w(n) {
  const [o, r] = i(!1);
  return u(() => {
    const s = (e) => {
      (e.key === n || e.metaKey || e.ctrlKey) && r(!0);
    }, t = (e) => {
      (e.key === n || !e.metaKey && !e.ctrlKey) && r(!1);
    }, d = () => {
      r(!1);
    };
    return window.addEventListener("keydown", s), window.addEventListener("keyup", t), window.addEventListener("blur", d), () => {
      window.removeEventListener("keydown", s), window.removeEventListener("keyup", t), window.removeEventListener("blur", d);
    };
  }, [n]), o;
}
function a() {
  return w("Meta");
}
export {
  a as useCmdOrCtrlPressed,
  w as useKeyPressed
};
//# sourceMappingURL=use-key-pressed.js.map
