Gamepad Node: Difference between revisions
(Adds descriptions of settings) |
(Adds additional troubleshooting info for browser/gamepad compatability issues, adds information about removed 'Index' option.) |
||
Line 2: | Line 2: | ||
{| class="wikitable" | {| class="wikitable" | ||
|+ | |+ | ||
!'''NOTICE:''' | !'''NOTICE:''' Gamepad support is sporadic. Different web browsers and devices support different levels of access to hardware peripherals (such as gamepads). In particular, Firefox does not allow the use of Gamepads at all. See the "Browser Support" section for details. We are working to improve this node's ability to work with gamepads across all browsers and devices, however we cannot guarantee that your specific controller/device/browser combination will work. If you encounter issues, experiment with different web browsers and/or controllers. | ||
|} | |} | ||
{{Node Data | {{Node Data | ||
Line 27: | Line 27: | ||
The Gamepad Input Node's settings window starts out simply with only one configurable option and a button next to "Open Gamepad Selector". In this initial state, the button indicates whether or not the currently configured gamepad is found (by default, no gamepad is configured, so the button displays "gamepad "none" detected"). Clicking the button will open up the '''Gamepad Selector''' dialogue, which allows you to select a gamepad from a drop-down list of detected gamepads and also specify which buttons and axes are tracked on that gamepad (i.e. which ones this node will use as output ports). Because the Gamepad Selector requires the configured gamepad to be connected in order to list available axes and buttons, it '''will wipe all selected axis and buttons if you open it without the configured gamepad detected'''. | The Gamepad Input Node's settings window starts out simply with only one configurable option and a button next to "Open Gamepad Selector". In this initial state, the button indicates whether or not the currently configured gamepad is found (by default, no gamepad is configured, so the button displays "gamepad "none" detected"). Clicking the button will open up the '''Gamepad Selector''' dialogue, which allows you to select a gamepad from a drop-down list of detected gamepads and also specify which buttons and axes are tracked on that gamepad (i.e. which ones this node will use as output ports). Because the Gamepad Selector requires the configured gamepad to be connected in order to list available axes and buttons, it '''will wipe all selected axis and buttons if you open it without the configured gamepad detected'''. | ||
*'''ID''': Provides a drop-down box that lists all currently connected Gamepads by their unique vendor IDs. This will automatically select the currently configured gamepad's ID, or go to "none" if it cannot be found. | *'''ID''': Provides a drop-down box that lists all currently connected Gamepads by their unique vendor IDs. This will automatically select the currently configured gamepad's ID, or go to "none" if it cannot be found. | ||
*'''Index''': Rarely you may want to connect more than one gamepad of the same type (with the same ID) to a single device. This lets you specify which gamepad you are referencing. Under most normal use cases, '''this should be left as "0"'''. | <!--*'''Index''': Rarely you may want to connect more than one gamepad of the same type (with the same ID) to a single device. This lets you specify which gamepad you are referencing. Under most normal use cases, '''this should be left as "0"'''.--> | ||
*'''Buttons and Axes''': A list of all buttons and axes available on the currently connected (and configured) gamepad. Each one can indpendently be selected with a checkbox on its left - check this checkbox will set that axis or button as an output port on the node in order to forward gamepad signals into the nodegraph. Make sure you read the "Outputs" section above to understand how these work. | *'''Buttons and Axes''': A list of all buttons and axes available on the currently connected (and configured) gamepad. Each one can indpendently be selected with a checkbox on its left - check this checkbox will set that axis or button as an output port on the node in order to forward gamepad signals into the nodegraph. Make sure you read the "Outputs" section above to understand how these work. | ||
*'''Sample Rate (ms)''': The physical gamepad must be sampled at regular intervals to read the values of each of axes and buttons set to be emitted - this setting configures the interval that this happens at. A higher interval will result in higher percieved delay lag between interacting with a physical gamepad input and the node emitting a signal, while a lower interval will result in more responsive output emissions, but might cause lag within your web browser as it attempts to rapidly sample the gamepad. | *'''Sample Rate (ms)''': The physical gamepad must be sampled at regular intervals to read the values of each of axes and buttons set to be emitted - this setting configures the interval that this happens at. A higher interval will result in higher percieved delay lag between interacting with a physical gamepad input and the node emitting a signal, while a lower interval will result in more responsive output emissions, but might cause lag within your web browser as it attempts to rapidly sample the gamepad. | ||
==Browser Support== | |||
Gamepad support is not very well standardised across mobile devices and web browsers. As a result, gamepads may sometimes not work or not be available to the RoboPad. All versions of firefox - both mobile and PC - do not allow RoboPad access to connected gamepads due to security concerns with allowing non-https site access to peripherals. Most other browsers either allow access directly, or may have a security setting that you are required to disable to allow access: | |||
<!-- TODO: Make the below data automatically pull from https://unpkg.com/@mdn/browser-compat-data@5.5.25/data.json -> api/Gamepad/secure_context_required --> | |||
*Chrome, Chromium: `#restrict-gamepad-access` found by visiting [chrome://flags chrome://flags] must be set to "Disabled". | |||
*Edge: `#restrict-gamepad-access` found by visiting [about:flags about:flags] must be set to "Disabled". | |||
*Opera: `#restrict-gamepad-access` found by visiting [opera://flags opera://flags] must be set to "Disabled". | |||
Further, you can check whether your gamepad is compatible with the webgamepad API by visiting an online gamepad tester such as [https://hardwaretester.com/gamepad Hardware Tester's GamePad Tester]. | |||
==Previous Versions== | |||
In firmware versions 2.4-b2 and 2.4-b3, this node had an "Index" setting, which let you specify which gamepad the node would connect to in the situation that there were more than one type of gamepad connected with the same unique vendor ID. This was to handle the case where multiple identical controllers were pulgged into a single phone/computer connected to a RoboPad. However, this was removed in 2.4-b4 onward, as it added extra confusion to the configuration process. This feature may be re-introduced in the future, but for now is considered deprecated. |
Revision as of 15:37, 7 May 2024
NOTICE: Gamepad support is sporadic. Different web browsers and devices support different levels of access to hardware peripherals (such as gamepads). In particular, Firefox does not allow the use of Gamepads at all. See the "Browser Support" section for details. We are working to improve this node's ability to work with gamepads across all browsers and devices, however we cannot guarantee that your specific controller/device/browser combination will work. If you encounter issues, experiment with different web browsers and/or controllers. |
---|
Inputs
|
Outputs
|
Version Introduced 2.4-b2 |
The Gamepad Input Node is a Node that can be configured to search for a specific physically attached gamepad controller which, upon finding, can be configured to transmit axis (analogue stick/trigger movements) and button signals into the nodegraph.
Gamepad Nodes were introduced in firmware version 2.4-b2.
Outputs
By default the Gamepad Node only has one output port - connected. This output port emits a low (0) initially, but then a high (1) when the node's configured gamepad is found.
Further outputs of the form axis a, axis b, axis c, etc as well as button a, button b, button c, etc that track the states of physical button bushes and analogue stick movements on the physical controller.
Note that axis signals will usually present between -1 and 1, while button signals will usually present between 0 and 1. Make sure you have fully understood the signals coming out of the node with your specific configuration before you connect any outputs to any physical actuators - it is recommended to attach the outputs to an Indicator Node first to check that you understand what signals the node is emitting.
Settings
The Gamepad Input Node's settings window starts out simply with only one configurable option and a button next to "Open Gamepad Selector". In this initial state, the button indicates whether or not the currently configured gamepad is found (by default, no gamepad is configured, so the button displays "gamepad "none" detected"). Clicking the button will open up the Gamepad Selector dialogue, which allows you to select a gamepad from a drop-down list of detected gamepads and also specify which buttons and axes are tracked on that gamepad (i.e. which ones this node will use as output ports). Because the Gamepad Selector requires the configured gamepad to be connected in order to list available axes and buttons, it will wipe all selected axis and buttons if you open it without the configured gamepad detected.
- ID: Provides a drop-down box that lists all currently connected Gamepads by their unique vendor IDs. This will automatically select the currently configured gamepad's ID, or go to "none" if it cannot be found.
- Buttons and Axes: A list of all buttons and axes available on the currently connected (and configured) gamepad. Each one can indpendently be selected with a checkbox on its left - check this checkbox will set that axis or button as an output port on the node in order to forward gamepad signals into the nodegraph. Make sure you read the "Outputs" section above to understand how these work.
- Sample Rate (ms): The physical gamepad must be sampled at regular intervals to read the values of each of axes and buttons set to be emitted - this setting configures the interval that this happens at. A higher interval will result in higher percieved delay lag between interacting with a physical gamepad input and the node emitting a signal, while a lower interval will result in more responsive output emissions, but might cause lag within your web browser as it attempts to rapidly sample the gamepad.
Browser Support
Gamepad support is not very well standardised across mobile devices and web browsers. As a result, gamepads may sometimes not work or not be available to the RoboPad. All versions of firefox - both mobile and PC - do not allow RoboPad access to connected gamepads due to security concerns with allowing non-https site access to peripherals. Most other browsers either allow access directly, or may have a security setting that you are required to disable to allow access:
- Chrome, Chromium: `#restrict-gamepad-access` found by visiting [chrome://flags chrome://flags] must be set to "Disabled".
- Edge: `#restrict-gamepad-access` found by visiting [about:flags about:flags] must be set to "Disabled".
- Opera: `#restrict-gamepad-access` found by visiting [opera://flags opera://flags] must be set to "Disabled".
Further, you can check whether your gamepad is compatible with the webgamepad API by visiting an online gamepad tester such as Hardware Tester's GamePad Tester.
Previous Versions
In firmware versions 2.4-b2 and 2.4-b3, this node had an "Index" setting, which let you specify which gamepad the node would connect to in the situation that there were more than one type of gamepad connected with the same unique vendor ID. This was to handle the case where multiple identical controllers were pulgged into a single phone/computer connected to a RoboPad. However, this was removed in 2.4-b4 onward, as it added extra confusion to the configuration process. This feature may be re-introduced in the future, but for now is considered deprecated.