w3c / gamepad

Gamepad
https://w3c.github.io/gamepad/
Other
139 stars 49 forks source link

Light Indicator #67

Open knyg opened 6 years ago

knyg commented 6 years ago

Many controllers support the concept of a light indicator to represent the player index of a controller. This is helpful to the user to know which player character is being controlled without testing each controller. Additionally, some games are only playable using a controller with a specific player index. In the context of VR, controllers may support a light indicator to assist the application in determining the location of the player. Light indicators range from monochrome light indicators (ON/OFF) to RGB light indicators.

We'd like to bring gamepad extension support to the same level of support provided by native functionality with the following proposal: Light Indicator Proposal

Please let us know if you have any questions, comments, or feedback.

nondebug commented 6 years ago

@knyg:

"monochrome" suggests that the light supports varying shades of one color, but the API only allows it to be fully-on or fully-off. Could we rename this to something like "on-off" or "binary" to make this clearer?

The proposal exposes the current indicator color as a property of the light indicator, but I'm not sure that this is always possible to query from the device. Supporting this for devices that don't expose the indicator state will require encoding device-specific details into the user agent to either guess at the initial value or set it to a reasonable default on connection. Can we do without it?

knyg commented 6 years ago

@nondebug

"monochrome" suggests that the light supports varying shades of one color

Agreed, "on-off" will be clearer.

Good point about obtaining the current color. I think it can safely be removed since setting the color will return a Promise, indicating whether the color was set correctly.

knyg commented 6 years ago

@nondebug

Proposal updated with suggestions - light indicator updates

haykam821 commented 6 years ago

Some gamepads (such as Nintendo Switch with light ring on home button) have a button associated with a light or backlighting in general. Perhaps this can be expanded to include null (for no lighting on a button) or that light, so we can toggle a light from its button?

fernando-80 commented 5 years ago

Some gamepads (such as Nintendo Switch with light ring on home button) have a button associated with a light or backlighting in general. Perhaps this can be expanded to include null (for no lighting on a button) or that light, so we can toggle a light from its button?

@haykam821 according to @knyg comment on Jan/14/2018, the scope of this extension is to represent the light indicator bar with the intention of, for example, to let user to know which player character is being controlled without testing each controller. Button lightning/backlighting has different purposes, intentions and behaviors of a lightbar and, thus, it's out of the scope of this lightbar gamepad extension proposal.