Open davey3000 opened 11 years ago
I believe the required change in Chromium is to remove all references to ever_interacted_with_
from the files:
chromium/src/content/renderer/gamepad_shared_memory_reader.h chromium/src/content/renderer/gamepad_shared_memory_reader.cc
In particular, the section of code that implements the "press face button to connect" security policy on gamepads appears to be the following code near the end of gamepad_shared_memory_reader.cc:
if (!ever_interacted_with_) {
if (GamepadsHaveUserGesture(gamepads)) {
ever_interacted_with_ = true;
} else {
// Clear the connected flag if the user hasn't interacted with any of the
// gamepads to prevent fingerprinting. The actual data is not cleared.
// WebKit will only copy out data into the JS buffers for connected
// gamepads so this is sufficient.
for (unsigned i = 0; i < WebKit::WebGamepads::itemsLengthCap; i++)
gamepads.items[i].connected = false;
}
}
Note that this is untested.
Is this issue dead? I would still like to see this merged, or at least a response as to why not.
ditto, I would like to see the face button press requirement removed too otherwise, does anyone know of a way to tell chromium a face button has been pressed via node if a gamepad is detected as being physically connected to the PC? therefore bypassing the required user interaction to press a face button everytime they start my app...
I'd like to see this issue resolved also as we had problems on a device that has joystick axes, but no buttons, so the gamepad is never activated.
Hi, This would be a great feature for me too. I currently have to code and display a message saying "please click a button before moving" in my app where clicking a button should be the last action (a validation) and not the first ...
For the record you could star and comment this issue in chromium to have a flag or permission to allow gamepad detection without user interaction.
The Chromium status says "WontFix", so will this not be resolved?
I also encountered the issue with RPG Maker MV, which now uses NW.js for the games. I kept pressing the directional buttons and nothing happened until I pressed a face button.
At present, input from non-face buttons on a connected gamepad are ignored until a face button is pressed. This security restriction seems unnecessary for windows that have access to Node.js, and could cause confusion to the user when they first start the application. I would like to suggest that this restriction be removed for windows that can access Node.js.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.