@hjopel/aframe-input-mapping-component
v0.1.11
Published
A Input Mapping component for A-Frame.
Downloads
127
Maintainers
Readme
aframe-input-mapping-component
Input Mapping component for A-Frame.
Read more about it on https://blog.mozvr.com/input-mapping
Installation
Browser
Install and use by directly including the browser files:
<head>
<title>My A-Frame Scene</title>
<script src="https://aframe.io/releases/0.6.0/aframe.min.js"></script>
<script src="https://unpkg.com/aframe-input-mapping-component/dist/aframe-input-mapping-component.min.js"></script>
</head>
npm
Install via npm:
npm install aframe-input-mapping-component
Then require and use.
require('aframe');
require('aframe-input-mapping-component');
Register a new mapping
Define a mapping object:
var mappings = {
default: {
'vive-controls': {
trackpaddown: 'teleport'
},
'oculus-touch-controls': {
xbuttondown: 'teleport'
}
},
paint: {
common: {
triggerdown: 'paint'
},
'vive-controls': {
menudown: 'toggleMenu'
},
'oculus-touch-controls': {
abuttondown: 'toggleMenu'
}
}
}
Register it:
AFRAME.registerInputMappings(mappings);