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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 | 257 |
258 KeyboardCode KeyboardCodeFromNative(const base::NativeEvent& native_event) { | 258 KeyboardCode KeyboardCodeFromNative(const base::NativeEvent& native_event) { |
259 return KeyboardCodeForWindowsKeyCode(static_cast<WORD>(native_event.wParam)); | 259 return KeyboardCodeForWindowsKeyCode(static_cast<WORD>(native_event.wParam)); |
260 } | 260 } |
261 | 261 |
262 DomCode CodeFromNative(const base::NativeEvent& native_event) { | 262 DomCode CodeFromNative(const base::NativeEvent& native_event) { |
263 const uint16 scan_code = GetScanCodeFromLParam(native_event.lParam); | 263 const uint16 scan_code = GetScanCodeFromLParam(native_event.lParam); |
264 return CodeForWindowsScanCode(scan_code); | 264 return CodeForWindowsScanCode(scan_code); |
265 } | 265 } |
266 | 266 |
267 uint32 PlatformKeycodeFromNative(const base::NativeEvent& native_event) { | |
268 return static_cast<uint32>(native_event.wParam); | |
269 } | |
270 | |
271 bool IsCharFromNative(const base::NativeEvent& native_event) { | 267 bool IsCharFromNative(const base::NativeEvent& native_event) { |
272 return native_event.message == WM_CHAR; | 268 return native_event.message == WM_CHAR; |
273 } | 269 } |
274 | 270 |
275 int GetChangedMouseButtonFlagsFromNative( | 271 int GetChangedMouseButtonFlagsFromNative( |
276 const base::NativeEvent& native_event) { | 272 const base::NativeEvent& native_event) { |
277 switch (GetNativeMouseKey(native_event)) { | 273 switch (GetNativeMouseKey(native_event)) { |
278 case MK_LBUTTON: | 274 case MK_LBUTTON: |
279 return EF_LEFT_MOUSE_BUTTON; | 275 return EF_LEFT_MOUSE_BUTTON; |
280 case MK_MBUTTON: | 276 case MK_MBUTTON: |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 } | 401 } |
406 | 402 |
407 LPARAM GetLParamFromScanCode(uint16 scan_code) { | 403 LPARAM GetLParamFromScanCode(uint16 scan_code) { |
408 LPARAM l_param = static_cast<LPARAM>(scan_code & 0x00FF) << 16; | 404 LPARAM l_param = static_cast<LPARAM>(scan_code & 0x00FF) << 16; |
409 if ((scan_code & 0xE000) == 0xE000) | 405 if ((scan_code & 0xE000) == 0xE000) |
410 l_param |= (1 << 24); | 406 l_param |= (1 << 24); |
411 return l_param; | 407 return l_param; |
412 } | 408 } |
413 | 409 |
414 } // namespace ui | 410 } // namespace ui |
OLD | NEW |