| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "ui/events/blink/web_input_event_builders_win.h" | 5 #include "ui/events/blink/web_input_event_builders_win.h" |
| 6 | 6 |
| 7 #include "ui/display/win/screen_win.h" | 7 #include "ui/display/win/screen_win.h" |
| 8 #include "ui/events/blink/blink_event_util.h" | 8 #include "ui/events/blink/blink_event_util.h" |
| 9 #include "ui/events/event_utils.h" | 9 #include "ui/events/event_utils.h" |
| 10 | 10 |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 // Currently we leave hasPreciseScrollingDeltas false, even for trackpad | 296 // Currently we leave hasPreciseScrollingDeltas false, even for trackpad |
| 297 // scrolls that generate WM_MOUSEWHEEL, since we don't have a good way to | 297 // scrolls that generate WM_MOUSEWHEEL, since we don't have a good way to |
| 298 // distinguish these from real mouse wheels (crbug.com/545234). | 298 // distinguish these from real mouse wheels (crbug.com/545234). |
| 299 wheel_delta = static_cast<float>(GET_WHEEL_DELTA_WPARAM(wparam)); | 299 wheel_delta = static_cast<float>(GET_WHEEL_DELTA_WPARAM(wparam)); |
| 300 | 300 |
| 301 if (message == WM_MOUSEHWHEEL) { | 301 if (message == WM_MOUSEHWHEEL) { |
| 302 horizontal_scroll = true; | 302 horizontal_scroll = true; |
| 303 wheel_delta = -wheel_delta; // Windows is <- -/+ ->, WebKit <- +/- ->. | 303 wheel_delta = -wheel_delta; // Windows is <- -/+ ->, WebKit <- +/- ->. |
| 304 } | 304 } |
| 305 } | 305 } |
| 306 if (key_state & MK_SHIFT) | |
| 307 horizontal_scroll = true; | |
| 308 | 306 |
| 309 // Set modifiers based on key state. | 307 // Set modifiers based on key state. |
| 310 result.modifiers = | 308 result.modifiers = |
| 311 ui::EventFlagsToWebEventModifiers(ui::GetModifiersFromKeyState()); | 309 ui::EventFlagsToWebEventModifiers(ui::GetModifiersFromKeyState()); |
| 312 if (key_state & MK_SHIFT) | 310 if (key_state & MK_SHIFT) |
| 313 result.modifiers |= WebInputEvent::ShiftKey; | 311 result.modifiers |= WebInputEvent::ShiftKey; |
| 314 if (key_state & MK_CONTROL) | 312 if (key_state & MK_CONTROL) |
| 315 result.modifiers |= WebInputEvent::ControlKey; | 313 result.modifiers |= WebInputEvent::ControlKey; |
| 316 if (key_state & MK_LBUTTON) | 314 if (key_state & MK_LBUTTON) |
| 317 result.modifiers |= WebInputEvent::LeftButtonDown; | 315 result.modifiers |= WebInputEvent::LeftButtonDown; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 result.wheelTicksX = wheel_delta; | 365 result.wheelTicksX = wheel_delta; |
| 368 } else { | 366 } else { |
| 369 result.deltaY = scroll_delta; | 367 result.deltaY = scroll_delta; |
| 370 result.wheelTicksY = wheel_delta; | 368 result.wheelTicksY = wheel_delta; |
| 371 } | 369 } |
| 372 | 370 |
| 373 return result; | 371 return result; |
| 374 } | 372 } |
| 375 | 373 |
| 376 } // namespace ui | 374 } // namespace ui |
| OLD | NEW |