Skip to content

Conversation

@ganeshprasads
Copy link
Contributor

Analog button should have values from 0.0 to 1.0 instead of only digital value.

https://www.w3.org/TR/gamepad/#dom-gamepadbutton-value

value attribute
For buttons that have an analog sensor, this property MUST represent the amount which the button has been pressed. All button values MUST be linearly normalized to the range [0.0 ... 1.0]. 0.0 MUST mean fully unpressed, and 1.0 MUST mean fully pressed. For buttons without an analog sensor, only the values 0.0 and 1.0 for fully unpressed and fully pressed respectively, MUST be provided.
This supersedes #133

…tal value.

https://www.w3.org/TR/gamepad/#dom-gamepadbutton-value

value attribute
For buttons that have an analog sensor, this property MUST represent the amount which the button has been pressed. All button values MUST be linearly normalized to the range [0.0 .. 1.0]. 0.0 MUST mean fully unpressed, and 1.0 MUST mean fully pressed. For buttons without an analog sensor, only the values 0.0 and 1.0 for fully unpressed and fully pressed respectively, MUST be provided.
@magomez magomez merged commit 77fc241 into WebPlatformForEmbedded:master Jan 13, 2025
aperezdc pushed a commit that referenced this pull request Jan 21, 2025
…tal value. (#134)

https://www.w3.org/TR/gamepad/#dom-gamepadbutton-value

value attribute
For buttons that have an analog sensor, this property MUST represent the amount which the button has been pressed. All button values MUST be linearly normalized to the range [0.0 .. 1.0]. 0.0 MUST mean fully unpressed, and 1.0 MUST mean fully pressed. For buttons without an analog sensor, only the values 0.0 and 1.0 for fully unpressed and fully pressed respectively, MUST be provided.

Co-authored-by: Ganesh prasad Sahu <GaneshPrasad_Sahu@comcast.com>
(cherry picked from commit 77fc241)
cadubentzen added a commit to cadubentzen/libwpe that referenced this pull request Feb 6, 2025
In WebPlatformForEmbedded#134, the analog_button_changed field was added to
wpe_gamepad_client_interface, but it missed removing one of trailing
reserved fields, so the struct size grew and broke upstream WPE build
in developer mode:

```
GamepadLibWPE.cpp:62:5: error: missing field '_wpe_reserved3' initializer [-Werror,-Wmissing-field-initializers]
```
aperezdc pushed a commit that referenced this pull request Feb 6, 2025
In #134, the analog_button_changed field was added to
wpe_gamepad_client_interface, but it missed removing one of trailing
reserved fields, so the struct size grew and broke upstream WPE build
in developer mode:

```
GamepadLibWPE.cpp:62:5: error: missing field '_wpe_reserved3' initializer [-Werror,-Wmissing-field-initializers]
```
aperezdc pushed a commit that referenced this pull request Feb 6, 2025
In #134, the analog_button_changed field was added to
wpe_gamepad_client_interface, but it missed removing one of trailing
reserved fields, so the struct size grew and broke upstream WPE build
in developer mode:

```
GamepadLibWPE.cpp:62:5: error: missing field '_wpe_reserved3' initializer [-Werror,-Wmissing-field-initializers]
```

(cherry picked from commit 3acbb9f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants