Identity the mouse pointer type from low-level events for Windows |
||||||||||
Issue descriptionNow 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.
,
May 26 2016
+ananta@, for Windows input knowledge.
,
Jun 1 2016
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.
,
Jun 1 2016
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
,
Jun 1 2016
+kylixrd. He was looking at something similar on Windows.
,
Jun 1 2016
I have a patch for this issue. I found this is useful. https://msdn.microsoft.com/en-us/library/windows/desktop/ms703320(v=vs.85).aspx https://codereview.chromium.org/2020143003/
,
Jun 1 2016
Oh sweet! I didn't expect that approach to work. Nice to see that it did.
,
Jun 2 2016
Note that this still doesn't give us proximity events.
,
Jun 2 2016
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.
,
Jun 2 2016
,
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
,
Jun 6 2016
,
Jun 7 2016
Your change meets the bar and is auto-approved for M52 (branch: 2743)
,
Jun 8 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
,
Jun 8 2016
Thanks for the merge, if there is no pending work, please tag the bug as fixed.
,
Jun 8 2016
,
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
,
Jun 15 2016
lanwei@, can you please let us know if this can be tested manually ?
,
Jun 15 2016
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.
,
Jun 15 2016
Please check with mouse, touch and a stylus device. |
||||||||||
►
Sign in to add a comment |
||||||||||
Comment 1 by mustaq@chromium.org
, May 26 2016Summary: 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)