12345 |
- /*
- All material copyright ESRI, All Rights Reserved, unless otherwise specified.
- See https://js.arcgis.com/4.25/esri/copyright.txt for details.
- */
- import{eventKey as r}from"../../core/events.js";import has from"../../core/has.js";const e=has("mac")?"Meta":"Ctrl",t={8:"Backspace",9:"Tab",13:"Enter",27:"Escape",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete"};for(let n=48;n<58;n++)t[n]=String.fromCharCode(n);for(let n=1;n<25;n++)t[111+n]=`F${n}`;for(let n=65;n<91;n++)t[n]=[String.fromCharCode(n+32),String.fromCharCode(n)];function o(e){if(void 0!==e.key)return r(e);const o=t[e.keyCode];return Array.isArray(o)?e.shiftKey?o[1]:o[0]:o}function a(r){switch(r){case"Ctrl":case"Alt":case"Shift":case"Meta":case"Primary":return!0}return!1}export{o as eventKey,a as isSystemModifier,e as primaryKey};
|