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

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

Issue 140653006: Add support for horizontal mouse wheel messages in Windows Desktop Aura. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <windowsx.h> 5 #include <windowsx.h>
6 6
7 #include "ui/events/event_constants.h" 7 #include "ui/events/event_constants.h"
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 case WM_NCRBUTTONUP: 173 case WM_NCRBUTTONUP:
174 case WM_NCXBUTTONUP: 174 case WM_NCXBUTTONUP:
175 case WM_RBUTTONUP: 175 case WM_RBUTTONUP:
176 case WM_XBUTTONUP: 176 case WM_XBUTTONUP:
177 return ET_MOUSE_RELEASED; 177 return ET_MOUSE_RELEASED;
178 case WM_MOUSEMOVE: 178 case WM_MOUSEMOVE:
179 return IsButtonDown(native_event) ? ET_MOUSE_DRAGGED : ET_MOUSE_MOVED; 179 return IsButtonDown(native_event) ? ET_MOUSE_DRAGGED : ET_MOUSE_MOVED;
180 case WM_NCMOUSEMOVE: 180 case WM_NCMOUSEMOVE:
181 return ET_MOUSE_MOVED; 181 return ET_MOUSE_MOVED;
182 case WM_MOUSEWHEEL: 182 case WM_MOUSEWHEEL:
183 case WM_MOUSEHWHEEL:
183 return ET_MOUSEWHEEL; 184 return ET_MOUSEWHEEL;
184 case WM_MOUSELEAVE: 185 case WM_MOUSELEAVE:
185 case WM_NCMOUSELEAVE: 186 case WM_NCMOUSELEAVE:
186 return ET_MOUSE_EXITED; 187 return ET_MOUSE_EXITED;
187 case WM_VSCROLL: 188 case WM_VSCROLL:
188 case WM_HSCROLL: 189 case WM_HSCROLL:
189 return ET_SCROLL; 190 return ET_SCROLL;
190 default: 191 default:
191 // We can't NOTREACHED() here, since this function can be called for any 192 // We can't NOTREACHED() here, since this function can be called for any
192 // message. 193 // message.
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 case MK_RBUTTON: 262 case MK_RBUTTON:
262 return EF_RIGHT_MOUSE_BUTTON; 263 return EF_RIGHT_MOUSE_BUTTON;
263 // TODO: add support for MK_XBUTTON1. 264 // TODO: add support for MK_XBUTTON1.
264 default: 265 default:
265 break; 266 break;
266 } 267 }
267 return 0; 268 return 0;
268 } 269 }
269 270
270 gfx::Vector2d GetMouseWheelOffset(const base::NativeEvent& native_event) { 271 gfx::Vector2d GetMouseWheelOffset(const base::NativeEvent& native_event) {
271 DCHECK(native_event.message == WM_MOUSEWHEEL); 272 DCHECK(native_event.message == WM_MOUSEWHEEL ||
273 native_event.message == WM_MOUSEHWHEEL);
272 return gfx::Vector2d(0, GET_WHEEL_DELTA_WPARAM(native_event.wParam)); 274 return gfx::Vector2d(0, GET_WHEEL_DELTA_WPARAM(native_event.wParam));
sky 2014/01/17 00:35:18 WOuldn't a horizontal scroll effect the first para
ananta 2014/01/17 00:47:17 Doh. Should have seen that. Works in desktop Chrom
273 } 275 }
274 276
275 void ClearTouchIdIfReleased(const base::NativeEvent& xev) { 277 void ClearTouchIdIfReleased(const base::NativeEvent& xev) {
276 NOTIMPLEMENTED(); 278 NOTIMPLEMENTED();
277 } 279 }
278 280
279 int GetTouchId(const base::NativeEvent& xev) { 281 int GetTouchId(const base::NativeEvent& xev) {
280 NOTIMPLEMENTED(); 282 NOTIMPLEMENTED();
281 return 0; 283 return 0;
282 } 284 }
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 } 409 }
408 410
409 LPARAM GetLParamFromScanCode(uint16 scan_code) { 411 LPARAM GetLParamFromScanCode(uint16 scan_code) {
410 LPARAM l_param = static_cast<LPARAM>(scan_code & 0x00FF) << 16; 412 LPARAM l_param = static_cast<LPARAM>(scan_code & 0x00FF) << 16;
411 if ((scan_code & 0xE000) == 0xE000) 413 if ((scan_code & 0xE000) == 0xE000)
412 l_param |= (1 << 24); 414 l_param |= (1 << 24);
413 return l_param; 415 return l_param;
414 } 416 }
415 417
416 } // namespace ui 418 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698