Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
dist
examples/basic
src
tests
.babelrc
.gitignore
.npmignore
.travis.yml
LICENSE
README.md
index.html
mapping.png
package-lock.json
package.json
webpack.config.js

README.md

aframe-input-mapping-component

Version License

Input Mapping component for A-Frame.

Read more about it on https://blog.mozvr.com/input-mapping

Screenshot

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);