项目作者: alvaromontoro

项目描述 :
A JS simulator for the Gamepad API
高级语言: JavaScript
项目地址: git://github.com/alvaromontoro/gamepad-simulator.git
创建时间: 2020-07-24T02:26:09Z
项目社区:https://github.com/alvaromontoro/gamepad-simulator

开源协议:MIT License

下载


gamepad-simulator

A JS simulator for testing the Gamepad API.

This module creates a virtual gamepad on the screen that triggers the same events that a real gamepad gamepad would.

How to use

  1. Import the file to your project
  2. Create the virtual gamepad on the screen with gamepadSimulator.create()
  3. Simulate the gamepad connection with gamepadSimulator.connect()
  4. Click ont he icons and axes and read the values using the standard navigator.getGamepads()
  5. Simulate the gamepad disconnection with gamepadSimulator.disconnect()
  6. Remove the virtual gamepad from the screen with gamepadSimulator.destroy()