gamepad-api

Modern way to read gamepad input in c#

梦想与她 提交于 2021-02-08 10:55:54
问题 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 popular libraries, like SharpDX or SlimDX are already abandoned and not supported. I end up using SharpLibHid that is messing with some raw input. And I even had some success. I am developing a WPF app, but that library requires WndProc from

HTML5 Gamepad API on Chrome

≯℡__Kan透↙ 提交于 2020-01-12 07:23:56
问题 I'm using Chrome (Version 19.0.1084.46). I enabled the Gamepad API in chrome://flags. I plugged in some game pads, but navigator.webkitGamepads is always an array of length 4 containing only undefined. navigator.webkitGamepads GamepadList 0: undefined 1: undefined 2: undefined 3: undefined length: 4 __proto__: GamepadList What do I need to do to test out using gamepads? I'm on Ubuntu Linux if that matters. 回答1: I was having trouble with this as well (on Ubuntu 10.04 with Chrome 21.0.1163.0

Gamepad API: Button events not firing

孤街浪徒 提交于 2020-01-05 03:59:28
问题 I have a bluetooth controller in which I've tested all the numbers of the buttons with this Gamepad tester: http://html5gamepad.com/, so I'm pretty sure the values of the buttons are correct. However, nothing seems to fire, the Gamepad is shown to be "connected", just the button events not working. Below is the code: function gameLoop() { if (navigator.webkitGetGamepads) { var wgp = navigator.webkitGetGamepads()[0]; if (wgp.buttons[12] == 1 || wgp.buttons[4] == 1) { console.log('move'); } };

BLE and Bluetooth gamepad options for Oculus

ぃ、小莉子 提交于 2019-12-11 17:49:33
问题 I'm planning to build a mobile app that sends over BLE a joystick commands with HID over GATT. Does Oculus external gamepad option will be able to connect to it? or it works only with Bluetooth?? therefore BLE won't work? I would appreciate if you could point me to similar examples. Thanks 回答1: Yes you can use HID over GATT with BLE to control Oculus. At least last time I tried the game Smash Hit with a standard BLE mouse the mouse button did the same thing as the oculus built in button. 回答2:

Kinect in HTML5 [closed]

家住魔仙堡 提交于 2019-12-03 03:12:00
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . Kinect for Windows has been just released on the 1st of February. Is there any good way to make it work with HTML5 games? Perhaps even somehow with the upcoming GamePad API...? Looking for ideas here, especially