aframe-input-mapping-component icon indicating copy to clipboard operation
aframe-input-mapping-component copied to clipboard

Error in Example with Logging

Open colinfizgig opened this issue 6 years ago • 0 comments

In the source code for the basic example you have...

scene.addEventListener('changeTask', function(evt) { var next = (keys.indexOf(AFRAME.currentInputMapping) + 1) % keys.length; AFRAME.currentInputMapping = keys[next]; mappingText.setAttribute('text', {value: 'Current mapping: ' + AFRAME.currentInputMapping}); logEvent(event); });

logEvent(event); should be changed to logEvent(evt); in order to work correctly.

or to keep it similar to the generic addEventListener function below it you could change it to

scene.addEventListener('changeTask', function(event) { var next = (keys.indexOf(AFRAME.currentInputMapping) + 1) % keys.length; AFRAME.currentInputMapping = keys[next]; mappingText.setAttribute('text', {value: 'Current mapping: ' + AFRAME.currentInputMapping}); logEvent(event); });

colinfizgig avatar Oct 09 '18 15:10 colinfizgig