aframe-input-mapping-component

0.1.3 • Public • Published

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

Package Sidebar

Install

npm i aframe-input-mapping-component

Weekly Downloads

17

Version

0.1.3

License

MIT

Last publish

Collaborators

  • fernandojsg