MCPcopy Index your code
hub / github.com/microsoft/SandDance / inputHandler

Function inputHandler

docs/app/js/sanddance-app.js:92851–92868  ·  view source on GitHub ↗

* handle input events * @param {Manager} manager * @param {String} eventType * @param {Object} input

(manager, eventType, input)

Source from the content-addressed store, hash-verified

92849 * @param {String} eventType
92850 * @param {Object} input
92851 */ function inputHandler(manager, eventType, input) {
92852 var pointersLen = input.pointers.length;
92853 var changedPointersLen = input.changedPointers.length;
92854 var isFirst = eventType & INPUT_START && pointersLen - changedPointersLen === 0;
92855 var isFinal = eventType & (INPUT_END | INPUT_CANCEL) && pointersLen - changedPointersLen === 0;
92856 input.isFirst = !!isFirst;
92857 input.isFinal = !!isFinal;
92858 if (isFirst) manager.session = {};
92859 // source event is the normalized value of the domEvents
92860 // like 'touchstart, mouseup, pointerdown'
92861 input.eventType = eventType;
92862 // compute scale, rotation etc
92863 computeInputData(manager, input);
92864 // emit secret event
92865 manager.emit("hammer.input", input);
92866 manager.recognize(input);
92867 manager.session.prevInput = input;
92868 }
92869 /**
92870 * extend the data with some usable properties like scale, rotate, velocity etc
92871 * @param {Object} manager

Callers

nothing calls this directly

Calls 1

computeInputDataFunction · 0.70

Tested by

no test coverage detected