OLD | NEW |
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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 | 248 |
249 KeyboardCode KeyboardCodeFromNative(const base::NativeEvent& native_event) { | 249 KeyboardCode KeyboardCodeFromNative(const base::NativeEvent& native_event) { |
250 return KeyboardCodeForWindowsKeyCode(native_event.wParam); | 250 return KeyboardCodeForWindowsKeyCode(native_event.wParam); |
251 } | 251 } |
252 | 252 |
253 const char* CodeFromNative(const base::NativeEvent& native_event) { | 253 const char* CodeFromNative(const base::NativeEvent& native_event) { |
254 const uint16 scan_code = GetScanCodeFromLParam(native_event.lParam); | 254 const uint16 scan_code = GetScanCodeFromLParam(native_event.lParam); |
255 return CodeForWindowsScanCode(scan_code); | 255 return CodeForWindowsScanCode(scan_code); |
256 } | 256 } |
257 | 257 |
| 258 uint32 PlatformKeycodeFromNative(const base::NativeEvent& native_event) { |
| 259 return static_cast<uint32>(native_event.wParam); |
| 260 } |
| 261 |
258 int GetChangedMouseButtonFlagsFromNative( | 262 int GetChangedMouseButtonFlagsFromNative( |
259 const base::NativeEvent& native_event) { | 263 const base::NativeEvent& native_event) { |
260 switch (GetNativeMouseKey(native_event)) { | 264 switch (GetNativeMouseKey(native_event)) { |
261 case MK_LBUTTON: | 265 case MK_LBUTTON: |
262 return EF_LEFT_MOUSE_BUTTON; | 266 return EF_LEFT_MOUSE_BUTTON; |
263 case MK_MBUTTON: | 267 case MK_MBUTTON: |
264 return EF_MIDDLE_MOUSE_BUTTON; | 268 return EF_MIDDLE_MOUSE_BUTTON; |
265 case MK_RBUTTON: | 269 case MK_RBUTTON: |
266 return EF_RIGHT_MOUSE_BUTTON; | 270 return EF_RIGHT_MOUSE_BUTTON; |
267 // TODO: add support for MK_XBUTTON1. | 271 // TODO: add support for MK_XBUTTON1. |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 } | 415 } |
412 | 416 |
413 LPARAM GetLParamFromScanCode(uint16 scan_code) { | 417 LPARAM GetLParamFromScanCode(uint16 scan_code) { |
414 LPARAM l_param = static_cast<LPARAM>(scan_code & 0x00FF) << 16; | 418 LPARAM l_param = static_cast<LPARAM>(scan_code & 0x00FF) << 16; |
415 if ((scan_code & 0xE000) == 0xE000) | 419 if ((scan_code & 0xE000) == 0xE000) |
416 l_param |= (1 << 24); | 420 l_param |= (1 << 24); |
417 return l_param; | 421 return l_param; |
418 } | 422 } |
419 | 423 |
420 } // namespace ui | 424 } // namespace ui |
OLD | NEW |