[ad_1]
The Google Stadia recreation streaming service relied on a proprietary controller. It was a fairly neat piece of {hardware} that sadly seemed destined for landfills when Google introduced that Stadia would discontinue. Fortunately it’s doable to make use of them as regular gamepads, and associated to that, [Thomas Steiner] has a developer weblog submit about how one can speak to the Stadia controller through WebHID.
(First, a fast recap: Bluetooth mode is a customized firmware that transforms a Stadia controller from proprietary system into normal gamepad that may be linked through USB cable, or wirelessly over Bluetooth.)
However right here’s the factor: normal gamepads have 17 whole buttons, however the Stadia controller really has 19 (the additional two are the Assistant and Seize buttons close to the middle of the unit.) These two additional buttons are completely useful, however the usual Gamepad API solely acknowledges buttons 0-16.
That’s the place the WebHID API is available in, permitting one to speak to the 2 further Stadia buttons. The Gamepad API handles all the same old gamepad stuff, and the WebHID API can entry occasions like button down and button up for the 2 further buttons not lined by the Gamepad API. There’s a demo and supply code demonstrating all of it working collectively.
Google’s termination of Stadia left a bitter style in lots of mouths. However efforts like this to maintain the controllers out of landfills are a superb route, even when they don’t actually erase the notion of Google as a company with a penchant for killing off merchandise that prospects actively use.
[ad_2]