9 Commits

Author SHA1 Message Date
Cameron Gutman
c7134a48db Use int for buttonFlags 2023-10-10 18:31:18 -05:00
Cameron Gutman
a191915b9d Improvements to haptic error handling
- Move gamepad index check to the JS side to simplify the code
- Handle gamepads that don't support haptics
2022-11-06 20:23:24 -06:00
utopiafallen
ce52398dc5 Validate controllers when handling rumble events from GameStream
Rumble events may be received for controllers that are no longer present or attached
so they should be dropped instead of being forwarded to JS for handling.
2022-11-06 19:58:35 -06:00
bob
aaa1ca7079 Added controller rumble support.
Pepper SDK and NaCl in general is EOL for Chrome, although still supported for Chrome Apps.
This means that the Pepper Gamepad API was never updated with rumble support so in order
to add rumble support, rumble messages from Gamestream have to be forwarded to JavaScript
and handled with gamepad.vibrationActuator.playEffect().

Side note, Chrome limits the duration of playEffect to 5 seconds and requesting more than
that causes the vibration request to be rejected.
2022-11-06 19:58:35 -06:00
Cameron Gutman
fdcd3d4747 Send attached gamepads at launch to fix L4D2 2018-01-20 15:08:36 -08:00
Cameron Gutman
15f7dbe49f Update to new common-c to show the correct number of controllers on the host PC 2017-02-04 20:41:28 -08:00
Cameron Gutman
8c258c3eb5 Skip counting controllers that haven't received a single event yet. This closes #38 2016-04-16 15:36:51 -04:00
Cameron Gutman
5577587718 Add special button to gamepad mapping and rename to reflect that it's a map of the standard HTML5 button layout, not anything XInput-specific 2016-02-16 15:49:59 -05:00
Cameron Gutman
ea94320c54 Add gamepad support for XInput devices on Windows 2016-02-13 04:29:14 -05:00