commit | dd3c80b45f6412cf442e35ff51cd0b28147878d6 | [log] [tgz] |
---|---|---|
author | Ella Ge <eirage@chromium.org> | Wed Sep 25 01:17:57 2019 |
committer | Commit Bot <commit-bot@chromium.org> | Wed Sep 25 01:17:57 2019 |
tree | 2da9744db208b621098fe44f255da8f6e2e95013 | |
parent | b52dc3790006edbdc8e52310c6061f0bf24d1fce [diff] |
Use WM_INPUT when pointerlock request unadjusted movement This CL adds support for pointerlock unadjusted movement on Windows behind flag. The api is added at crrev.com/c/1764943 behind flag. (design doc: https://docs.google.com/document/d/1vvnthXjzfZXiAx7ih-mVhGc_YJ8-_rtlAhIn8i6_6nM/) When entering pointer lock, if is requesting unadjusted movement, use |RegisterRawInputDevices| to listen to WM_INPUT messages, and set the |use_wm_input_| to true. When unlock, remove mouse as raw input device are reset the bit. When |use_wm_input_| is true(in lock and unadjusted movement mode), convert WM_INPUT messages into ET_MOUSE_MOVED events as they are representing mouse movements. The move/drag events from WM_MOUSE are suppressed. Since WM_INPUT messages do not have coordinates, use current mouse positions as the event coordinates so that there is no jump when switching between normal events and raw movement events. This CL adds a field movement_ in ui::MouseEvent to store the raw mouse movement info from the mouse raw input event. This field only valid if the event has EF_RAW_MOVEMENT flag set. Bug: 982379 Change-Id: Ia6e5969717917bbefc0579b5ed587a68df4b26ce Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1769518 Commit-Queue: Ella Ge <eirage@chromium.org> Reviewed-by: Scott Violet <sky@chromium.org> Reviewed-by: Navid Zolghadr <nzolghadr@chromium.org> Cr-Commit-Position: refs/heads/master@{#699577}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .