New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 614820 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug

Blocking:
issue 367113



Sign in to add a comment

Identity the mouse pointer type from low-level events for Windows

Project Member Reported by lanwei@chromium.org, May 25 2016

Issue description

Now in ui::GetMousePointerDetailsFromNative for events sending from Linux and Windows, we hard coded the pointer type as mouse. We should identity the pointer type of mouse device from low-level events, as such XEvent from Linux and HWND messages from Windows.
 

Comment 1 by mustaq@chromium.org, May 26 2016

Labels: -OS-Linux
Summary: Identity the mouse pointer type from low-level events for Windows (was: Identity the mouse pointer type from low-level events for Linux and Windows)
Renaming the bug to focus on Windows separately, which is more urgent for us.

Gene/Sadrul: any idea how to fix the hardcoded POINTER_TYPE_MOUSE in events_win.cc?

Cc: ananta@chromium.org
+ananta@, for Windows input knowledge.
Blocking: 367113
Note that other bug about the general problem: plumb not just pointerType but also other pointer properties like tilt, pressure, whatever available.

I will assign the other bug to you as well, in case you prefer working on the general problem now.
Lan and I discussed, and there is support in the current code base to distinguish {touch/pointer} from {mouse}, but if we want to distinguish touch from pointer, then we will need to:
- implement pointer events in win8+ (see  issue 367113 )
- call into the pen/ink API for nt/sp2 through win7
Cc: kylixrd@chromium.org
+kylixrd. He was looking at something similar on Windows.
Oh sweet! I didn't expect that approach to work.

Nice to see that it did.
Note that this still doesn't give us proximity events.
Agreed. It won't give us any extra info on the stylus (including which stylus, if they have multiple). For any of that, we'd need to use the approach mentioned in #4.
Status: Started (was: Assigned)
Project Member

Comment 11 by bugdroid1@chromium.org, Jun 6 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/16ac979eddbdd5ccc045092c1260e42dd38191f6

commit 16ac979eddbdd5ccc045092c1260e42dd38191f6
Author: lanwei <lanwei@chromium.org>
Date: Mon Jun 06 14:58:25 2016

We hard coded the pointer type as mouse in ui::GetMousePointerDetailsFromNative
for events sending from Windows. Now we use a mouse message from GetMessageExtraInfo to decide
the actual input device type.

GetMessageExtraInfo needs to be mask-checked against 0xFFFFFF00, and then compared
with 0xFF515700. True when this mouse message was generated by a Tablet PC pen or touch
screen. Otherwise it is from a mouse device. Additionally, in Windows Vista or later,
the eighth bit, masked by 0x80, is used to differentiate
touch input from pen input
(0 = pen, 1 = touch).

Reference:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms703320(v=vs.85).aspx

BUG= 614820 

Review-Url: https://codereview.chromium.org/2020143003
Cr-Commit-Position: refs/heads/master@{#398025}

[modify] https://crrev.com/16ac979eddbdd5ccc045092c1260e42dd38191f6/ui/events/win/events_win.cc

Labels: Merge-Request-52

Comment 13 by tin...@google.com, Jun 7 2016

Labels: -Merge-Request-52 Merge-Approved-52 Hotlist-Merge-Approved
Your change meets the bar and is auto-approved for M52 (branch: 2743)
Project Member

Comment 14 by bugdroid1@chromium.org, Jun 8 2016

Labels: -merge-approved-52 merge-merged-2743
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6f7dbeb652323de923942b2956ea12d81187894e

commit 6f7dbeb652323de923942b2956ea12d81187894e
Author: lanwei <lanwei@chromium.org>
Date: Wed Jun 08 15:11:40 2016

We hard coded the pointer type as mouse in ui::GetMousePointerDetailsFromNative for events sending from Windows. Now we use a mouse message from GetMessageExtraInfo to decide the actual input device type.

GetMessageExtraInfo needs to be mask-checked against 0xFFFFFF00, and then compared
with 0xFF515700. True when this mouse message was generated by a Tablet PC pen or touch
screen. Otherwise it is from a mouse device. Additionally, in Windows Vista or later,
the eighth bit, masked by 0x80, is used to differentiate
touch input from pen input
(0 = pen, 1 = touch).

Reference:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms703320(v=vs.85).aspx

BUG= 614820 

Review-Url: https://codereview.chromium.org/2020143003
Cr-Commit-Position: refs/heads/master@{#398025}
(cherry picked from commit 16ac979eddbdd5ccc045092c1260e42dd38191f6)

Review URL: https://codereview.chromium.org/2039813006 .

Cr-Commit-Position: refs/branch-heads/2743@{#279}
Cr-Branched-From: 2b3ae3b8090361f8af5a611712fc1a5ab2de53cb-refs/heads/master@{#394939}

[modify] https://crrev.com/6f7dbeb652323de923942b2956ea12d81187894e/ui/events/win/events_win.cc

Thanks for the merge, if there is no pending work, please tag the bug as fixed.
Status: Fixed (was: Started)
Project Member

Comment 17 by bugdroid1@chromium.org, Jun 15 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6f7dbeb652323de923942b2956ea12d81187894e

commit 6f7dbeb652323de923942b2956ea12d81187894e
Author: lanwei <lanwei@chromium.org>
Date: Wed Jun 08 15:11:40 2016

We hard coded the pointer type as mouse in ui::GetMousePointerDetailsFromNative for events sending from Windows. Now we use a mouse message from GetMessageExtraInfo to decide the actual input device type.

GetMessageExtraInfo needs to be mask-checked against 0xFFFFFF00, and then compared
with 0xFF515700. True when this mouse message was generated by a Tablet PC pen or touch
screen. Otherwise it is from a mouse device. Additionally, in Windows Vista or later,
the eighth bit, masked by 0x80, is used to differentiate
touch input from pen input
(0 = pen, 1 = touch).

Reference:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms703320(v=vs.85).aspx

BUG= 614820 

Review-Url: https://codereview.chromium.org/2020143003
Cr-Commit-Position: refs/heads/master@{#398025}
(cherry picked from commit 16ac979eddbdd5ccc045092c1260e42dd38191f6)

Review URL: https://codereview.chromium.org/2039813006 .

Cr-Commit-Position: refs/branch-heads/2743@{#279}
Cr-Branched-From: 2b3ae3b8090361f8af5a611712fc1a5ab2de53cb-refs/heads/master@{#394939}

[modify] https://crrev.com/6f7dbeb652323de923942b2956ea12d81187894e/ui/events/win/events_win.cc

Labels: Needs-Feedback
lanwei@, can you please let us know if this can be tested manually ?
Yes, please use this page http://rbyers.github.io/eventTest.html and choose only pointer in the config list on the top left. When you test, please enable Pointer Events Mac, Windows, Linux, Chrome OS, Android on the chrome://flags. 
Please check with mouse, touch and a stylus device.

Sign in to add a comment