Questions tagged [gamepad-api]

The Gamepad specification defines a low-level interface that represents gamepad devices.

The Gamepad specification defines a low-level interface that represents gamepad devices. The Web Gamepad API presents a way to access and use gamepads and other controllers for games. For more information see this: https://wiki.mozilla.org/GamepadAPI

78 questions
2
votes
1 answer

How can I request input data from a game controller via USB HID API?

I've been using the below API to get data from my game controllers and it's worked fine up until my new controller arrived, which has more than the 32 buttons the API supports (The Windows Game Controller control panel applet doesn't even show them…
NeoTechni
  • 158
  • 2
  • 10
2
votes
1 answer

TamperMonkey: Cannot read property 'dispatchEvent' of null

New to javascript here, I am messing around with using a gamepad while browsing (using gamepad API and TamperMonkey) and I am having trouble simulating to click a certain (x,y) coordinate on the screen. It reports "Cannot read property…
2
votes
2 answers

How to map DirectInput (sharpDX) device to it's corresponding HID (C#)

What I need is a way to find out the curresponding HID of a SharpDX.DirectInput DeviceInstance. What I have on DirectInput side is : ProductId -> 00060079-0000-0000-0000-504944564944 (always the same) InstanceId ->…
2
votes
1 answer

What is "onkeyup" in gamepad api?

I'm experimenting a little with gamepad api. When a button is pressed, it gets "fired" all the time until the button is released. This is cool for something like running or shooting in a game, but problematic, when I want to navigate inside a menu…
hdbrnd
  • 47
  • 4
2
votes
1 answer

Modern way to read gamepad input in c#

Question: I want to read gamepad/joystick input under c# and want to be able to tell which key is pressed. (at least few gamepad models) Google and stackoverflow are full of different outdated solutions, most of them are asked in 2011. Some of the…
2
votes
2 answers

Gamepad API "gamepadconnected" not working

I am using the Gamepad API "gamepadconnected" function which is not working properly. However, the "gamepaddisconnected" function works for some reason. Upon connecting my bluetooth controller, nothing shows in the console, however, it does show the…
Lord Goderick
  • 965
  • 2
  • 14
  • 32
2
votes
2 answers

Three.js camera rotation order

I'm trying to use a gamepad to rotate a camera in Three.js, using first-person-shooter style controls. The browser detects the gamepad and recognises it's input, but the camera's order of rotation is wrong. When I rotate on the camera's local Y…
1
vote
0 answers

Unable to access input sources for inline WebXR session

I would like to access input sources - in particular, the Quest touch controllers - during an inline WebXR session (not entering immersive VR mode; I am not using three.js or A-Frame) on the Quest browser. I request and store the session with the…
Stemkoski
  • 8,936
  • 3
  • 47
  • 61
1
vote
0 answers

How to get rid of webkit Gamepad API deadzone?

I'm using gamepad api1 to read controller axis value in a web based game, but found that the gamepad API always applies a certain amount of "deadzone" around the center of each axis, where the value doesn't change even when the gimbal on the…
MrW
  • 71
  • 2
  • 5
1
vote
0 answers

How do you emulate a game pad input to an Android device?

So I'm trying to create an application that can emulate a gamepad on device, kinda like how vjoy programs work for windows with a HID input emulator, but I can't figure out how, the best idea I've tried so far is to use a rubber ducky to emulate it…
Val
  • 11
  • 1
1
vote
1 answer

Is there a fix for the mismapping in the js Gamepad API?

I'm currently building a little game in vanilla JS, but as I was working on controller (specs at bottom) input it mismapped the buttons. It has the same number of inputs as the gamepad API standard controller, and all the same controls, but it…
Oct. Lips
  • 97
  • 1
  • 10
1
vote
0 answers

How to enable the GamePad feature for WKWebView in iOS?

I looked for the documentation, but I couldn't find the API. But I have tested Chrome for the iOS version, it is fine. I don't know how to enable it. Who can tell me, thank you very much.
HelloWorld
  • 35
  • 1
  • 4
1
vote
1 answer

Way to map GPIO buttons (RaspberryPi) to gamepad (Gamepad API)

I have RaspberryPi 4 with few buttons connected to GPIO pins. I want to map those buttons to act like gamepad to be accessable trough browser's Gamepad API. Is there any way on backend (NodeJS, Python) to map those raw inputs into actual gamepad…
Baterka
  • 3,075
  • 5
  • 31
  • 60
1
vote
1 answer

Navigator.getGamepads() doesn't return different instances of the same type of gamepad

As the title says, I don't get 2 different gamepads for the same type of controller (yes, I can see them in the Control Panel joy.cpl) i.e. using Windows I can see in joy.cpl the following list: Controller (XBOX 360 for Windows) Saitek Pro Flight…
danikaze
  • 1,550
  • 2
  • 16
  • 34
1
vote
2 answers

How to detect a button press with Gamepad API?

I am trying to write a web page where I can detect button presses on a Xbox controller and show a user a boolean value based on the button pressed. Right now, I can detect a controller being connected and show that as a string. The documentation…
Nathan
  • 65
  • 1
  • 4
  • 14