import{r as s,f6 as i,f7 as c,A as w}from"./index-dP1W1_bd.js";const f={Meta:"Control"},p=n=>{const[u,o]=s.useState(!1);s.useEffect(()=>{const e=()=>o(!1);return window.addEventListener("blur",e),()=>window.removeEventListener("blur",e)},[]);const{name:d}=i(),t=s.useMemo(()=>d===c.MAC?n:w(n,n,f),[d,n]),r=s.useCallback(({key:e})=>{e===t&&o(!0)},[t]),a=s.useCallback(({key:e})=>{e===t&&o(!1)},[t]);return s.useEffect(()=>(window.addEventListener("keydown",r),window.addEventListener("keyup",a),()=>{window.removeEventListener("keydown",r),window.removeEventListener("keyup",a)}),[r,a]),u};export{p as u};
