@doegis/core
Version:
DOE GIS API
3 lines (1 loc) • 1.27 kB
JavaScript
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";let n=class extends t{constructor(e){super(),this.nativeIndex=null,this._detectedDeviceType="unknown","standard"===e.mapping?this._detectedDeviceType="standard":o.test(e.id)?this._detectedDeviceType="spacemouse":this._detectedDeviceType="unknown",this.nativeIndex=e.index}get native(){const e=navigator.getGamepads?navigator.getGamepads():[];return null!=this.nativeIndex&&this.nativeIndex<e.length?e[this.nativeIndex]:null}get deviceType(){return this._detectedDeviceType}get axisThreshold(){return i[this.deviceType]}};e([s({nonNullable:!0,readOnly:!0})],n.prototype,"nativeIndex",void 0),e([s({type:String,readOnly:!0})],n.prototype,"deviceType",null),e([s({type:Number,readOnly:!0})],n.prototype,"axisThreshold",null),n=e([r("esri.views.input.gamepad.GamepadInputDevice")],n);const o=new RegExp("^(3dconnexion|space(mouse|navigator|pilot|explorer))","i"),i={standard:.15,spacemouse:.025,unknown:0},a=n;export{a as default};