
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
aframe-gamepad-controls
Advanced tools
gamepad-controls
ComponentGamepad controls for A-Frame VR.
Supports one or more gamepads, attached to an A-Frame scene.
This component uses the HTML5 Gamepad API. The underlying API supports Firefox, Chrome, Edge, and Opera (as of 01/2016). Safari and Internet Explorer do not currently support gamepads.
<html>
<head>
<!-- A-Frame VR Library -->
<script src="https://aframe.io/releases/latest/aframe.js"></script>
<!-- Component -->
<script src="dist/aframe-gamepad-controls.js"></script>
</head>
<body>
<a-scene>
<!-- ... -->
<a-entity camera gamepad-controls></a-entity>
</a-scene>
</body>
</html>
Install NPM module.
$ npm install aframe-gamepad-controls
Register gamepad-controls
component.
var AFRAME = require('aframe-core');
var GamepadControls = require('aframe-gamepad-controls');
AFRAME.registerComponent('gamepad-controls', GamepadControls);
Add markup.
<!-- First-person controls -->
<a-entity camera gamepad-controls></a-entity>
<!-- Third-person controls -->
<a-cube gamepad-controls="lookEnabled: false"></a-cube>
<!-- Two players -->
<a-model src="player1.obj" gamepad-controls="controller: 0; lookEnabled: false"></a-model>
<a-model src="player2.obj" gamepad-controls="controller: 1; lookEnabled: false"></a-model>
Property | Default | Description |
---|---|---|
controller | 0 | Which controller (0..3) the object should be attached to. |
enabled | true | Enables/disables all events on this controller. |
movementEnabled | true | Enables/disables movement via the left thumbstick. |
lookEnabled | true | Enables/disables view rotation via the right thumbstick. |
flyEnabled | false | Enables/disables movement off the horizontal plane. |
debug | false | Enables/disables debug logging to the console. |
FAQs
Gamepad controls for A-Frame.
We found that aframe-gamepad-controls demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.