Socket
Socket
Sign inDemoInstall

@ircam/motion-input

Package Overview
Dependencies
1
Maintainers
2
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @ircam/motion-input

Module that provides unified motion data across platforms (iOS and Android) and browsers


Version published
Weekly downloads
3
Maintainers
2
Created
Weekly downloads
 

Readme

Source

motion-input

Module that provides unified motion data across platforms (iOS and Android) and browsers.

Installation

npm install [--save] collective-soundworks/motion-input

Example

motion-input

Usage

const motionInput = require('motion-input');
 
motionInput
  .init(['accelerationIncludingGravity'])
  .then(([accelerationIncludingGravity]) => {

    if (accelerationIncludingGravity.isValid) {
      accelerationIncludingGravity.addListener(val => {
        console.log(val) 
      });
    }
    // ...
  })
  .catch(err => console.error(err.stack));

Warning

Due to some weird (buggy ?) behavior in Chrome and and Firefox, if you need to use both 'acceleration' and 'orientation' modules, 'acceleration' should always be initialized and listened before 'orientation'.

FAQs

Last updated on 30 May 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc