Title:
Intent to Ship: Unadjusted Movement
Body:
Contact emails
jamesh...@google.com, reillyg@google.com
Explainer
No explainer because this is simple enough to explain right here.
Spec
No tag review. This spec change seems small enough to not warrant a tag review.
Summary
The goal of this change is to allow application to access unadjusted mouse movement data while in Pointer Lock. This is a highly requested feature from partners in the gaming space. This change adds a PointerLockOptions object as a parameter to the requestPointerLock() method. The PointerLockOptions object currently only has one useful member which is the boolean unadjustedMovement. Also, to properly return error information and make it easier for developers to implement the requestPointerLock method was changed to return a promise.
The existing Pointer Lock API returns the mouse movement that the platforms give Chrome. By default all platforms include some form of mouse acceleration in the movement information they give Chrome. Mouse acceleration is the artificial increase of velocity when the mouse is moving fast. This is useful in normal use of the pointer when a user is trying to move the mouse across the screen. However, it also makes aiming in first person perspective games very difficult. To solve this problem we are adding an option to get that unadjusted movement data when requesting pointer lock.
With Pointer Lock options now available, applications need the ability to change those options while keeping the lock. This proves difficult using the previous API which fired changed or error events on the document to indicate the result of the request. Particularly troublesome was that the error event gave no reason. To solve this problem for developers a Promise workflow is being introduced. Now when requesting a change the developers can get actionable error information on rejected requests.
Example:
try {
await element.requestPointerLock({ unadjustedMovement: true });
console.log(“pointer lock acquired”);
} catch (error) {
console.log(`Failed to acquire pointer lock due to ${error}`);
}
Link to Intents
Link to Origin Trial feedback summary
Developer feedback was solicited on the bug. There is one comment that was addressed in a separate issue and a discussion with the developer who made the comment. Our partners deployed changes to use this API and provided feedback on the design.
Is this feature supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
This is available on all desktop platforms. Since this new option is about the mouse it does not make sense to have this on mobile.
Demo link
This site displays the difference in mouse movement.
Debuggability
Debugging this change is done through error messages in the rejection of the promise.
Risks
Interoperability and Compatibility
The spec pull request is here. There was some response from Firefox in the beginning but that stopped a while ago. Here are the official request for positions:
Ergonomics
This feature is frequently used with the Fullscreen API and there have been some problems with the two being used simultaneously which have been resolved. All members of the Origin Trial use these two in correlation successfully.
Activation
This will not break current users of the Pointer Lock API. However, developers do need to add the option in the request and use the Promise structure to take advantage of the new features.
Is this feature fully tested by web-platform-tests? Link to test suite results from wpt.fyi.
Here is the pull request for tentative Web Platform Tests which will be marked stable once the PR above is merged.
Actual testing of adjusted vs. unadjusted movement is very difficult to automate as it is dependent on platform-specific behavior and requires a hardware test setup to simulate mouse movements at a very low level.
Entry on the feature dashboard
Title:
Intent to Ship: Unadjusted Movement
Body:
Contact emails
jamesh...@google.com, reillyg@google.com
Explainer
https://github.com/slightlyoff/unadjusted_pointer_lock_explainer
Spec
No tag review. However TAG has been informed and agreed this did not need a full review.
Explainer has been created and Tag informed.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAPV%3DugzCLtGPqFOu4UbasNkVqaGD0tKSaOBQ-jehYRGCDGGSFA%40mail.gmail.com.
LGTM2
/Daniel
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CACj%3DBEg076ez3g%3Daakbd36GdFD5wmfgELUEbijbFMyw%2BCNFExw%40mail.gmail.com.
It's not nice that other vendors haven't replied to the signals requests
(despite they have been filled a while ago), as this is an API that has
support in other browsers right now too.
If I understood correctly this has two changes:
* Add unadjustedMovement option to requestPointerLock().
* Make requestPointerLock() to return a promise.
And I have 2 questions:
* I think there's some interop risk if people start to use the new
promise API in browsers that doesn't implement that yet.
For example if sites start to use the promise API like:
el.requestPointerLock().then(...);
They'll get errors in other browsers not returning a promise yet.
Should the documentation explain a clear way to avoid this with some way
to feature detect it?
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/54ba5532-73e4-0d8a-3414-e40186f40d94%40igalia.com.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/59751da7-032a-a28a-7a94-b03ceb37533f%40igalia.com.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/59751da7-032a-a28a-7a94-b03ceb37533f%40igalia.com.
Can we get a response to Thomas's request for an exception to the 1 week of breakage?
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/cfb49341-0be5-4efc-957e-ac7a1b9a3fc9n%40chromium.org.