Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Side by Side Diff: ui/events/win/events_win.cc

Issue 2655303004: Add id properties to PointerEvent (Closed)
Patch Set: pointer id Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdint.h> 5 #include <stdint.h>
6 #include <windowsx.h> 6 #include <windowsx.h>
7 7
8 #include "ui/events/event_constants.h" 8 #include "ui/events/event_constants.h"
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 return 0; 294 return 0;
295 } 295 }
296 296
297 PointerDetails GetMousePointerDetailsFromNative( 297 PointerDetails GetMousePointerDetailsFromNative(
298 const base::NativeEvent& native_event) { 298 const base::NativeEvent& native_event) {
299 // We should filter out all the mouse events Synthesized from touch events. 299 // We should filter out all the mouse events Synthesized from touch events.
300 // TODO(lanwei): Will set the pointer ID, see https://crbug.com/616771. 300 // TODO(lanwei): Will set the pointer ID, see https://crbug.com/616771.
301 if ((GetMessageExtraInfo() & SIGNATURE_MASK) != MOUSEEVENTF_FROMTOUCHPEN) 301 if ((GetMessageExtraInfo() & SIGNATURE_MASK) != MOUSEEVENTF_FROMTOUCHPEN)
302 return PointerDetails(EventPointerType::POINTER_TYPE_MOUSE); 302 return PointerDetails(EventPointerType::POINTER_TYPE_MOUSE);
303 303
304 return PointerDetails(EventPointerType::POINTER_TYPE_PEN); 304 return PointerDetails(EventPointerType::POINTER_TYPE_PEN,
305 PointerEvent::kMousePointerId);
305 } 306 }
306 307
307 gfx::Vector2d GetMouseWheelOffset(const base::NativeEvent& native_event) { 308 gfx::Vector2d GetMouseWheelOffset(const base::NativeEvent& native_event) {
308 DCHECK(native_event.message == WM_MOUSEWHEEL || 309 DCHECK(native_event.message == WM_MOUSEWHEEL ||
309 native_event.message == WM_MOUSEHWHEEL); 310 native_event.message == WM_MOUSEHWHEEL);
310 if (native_event.message == WM_MOUSEWHEEL) 311 if (native_event.message == WM_MOUSEWHEEL)
311 return gfx::Vector2d(0, GET_WHEEL_DELTA_WPARAM(native_event.wParam)); 312 return gfx::Vector2d(0, GET_WHEEL_DELTA_WPARAM(native_event.wParam));
312 return gfx::Vector2d(GET_WHEEL_DELTA_WPARAM(native_event.wParam), 0); 313 return gfx::Vector2d(GET_WHEEL_DELTA_WPARAM(native_event.wParam), 0);
313 } 314 }
314 315
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 } 416 }
416 417
417 LPARAM GetLParamFromScanCode(uint16_t scan_code) { 418 LPARAM GetLParamFromScanCode(uint16_t scan_code) {
418 LPARAM l_param = static_cast<LPARAM>(scan_code & 0x00FF) << 16; 419 LPARAM l_param = static_cast<LPARAM>(scan_code & 0x00FF) << 16;
419 if ((scan_code & 0xE000) == 0xE000) 420 if ((scan_code & 0xE000) == 0xE000)
420 l_param |= (1 << 24); 421 l_param |= (1 << 24);
421 return l_param; 422 return l_param;
422 } 423 }
423 424
424 } // namespace ui 425 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698