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

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

Issue 548303003: Revert of Removing X11 native_event uses for key events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « ui/events/ozone/events_ozone.cc ('k') | ui/events/x/events_x.cc » ('j') | 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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 } 257 }
258 258
259 uint32 PlatformKeycodeFromNative(const base::NativeEvent& native_event) { 259 uint32 PlatformKeycodeFromNative(const base::NativeEvent& native_event) {
260 return static_cast<uint32>(native_event.wParam); 260 return static_cast<uint32>(native_event.wParam);
261 } 261 }
262 262
263 bool IsCharFromNative(const base::NativeEvent& native_event) { 263 bool IsCharFromNative(const base::NativeEvent& native_event) {
264 return native_event.message == WM_CHAR; 264 return native_event.message == WM_CHAR;
265 } 265 }
266 266
267 uint32 WindowsKeycodeFromNative(const base::NativeEvent& native_event) {
268 return static_cast<uint32>(native_event.wParam);
269 }
270
271 uint16 TextFromNative(const base::NativeEvent& native_event) {
272 return static_cast<uint32>(native_event.wParam);
273 }
274
275 uint16 UnmodifiedTextFromNative(const base::NativeEvent& native_event) {
276 return static_cast<uint32>(native_event.wParam);
277 }
278
267 int GetChangedMouseButtonFlagsFromNative( 279 int GetChangedMouseButtonFlagsFromNative(
268 const base::NativeEvent& native_event) { 280 const base::NativeEvent& native_event) {
269 switch (GetNativeMouseKey(native_event)) { 281 switch (GetNativeMouseKey(native_event)) {
270 case MK_LBUTTON: 282 case MK_LBUTTON:
271 return EF_LEFT_MOUSE_BUTTON; 283 return EF_LEFT_MOUSE_BUTTON;
272 case MK_MBUTTON: 284 case MK_MBUTTON:
273 return EF_MIDDLE_MOUSE_BUTTON; 285 return EF_MIDDLE_MOUSE_BUTTON;
274 case MK_RBUTTON: 286 case MK_RBUTTON:
275 return EF_RIGHT_MOUSE_BUTTON; 287 return EF_RIGHT_MOUSE_BUTTON;
276 // TODO: add support for MK_XBUTTON1. 288 // TODO: add support for MK_XBUTTON1.
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 } 413 }
402 414
403 LPARAM GetLParamFromScanCode(uint16 scan_code) { 415 LPARAM GetLParamFromScanCode(uint16 scan_code) {
404 LPARAM l_param = static_cast<LPARAM>(scan_code & 0x00FF) << 16; 416 LPARAM l_param = static_cast<LPARAM>(scan_code & 0x00FF) << 16;
405 if ((scan_code & 0xE000) == 0xE000) 417 if ((scan_code & 0xE000) == 0xE000)
406 l_param |= (1 << 24); 418 l_param |= (1 << 24);
407 return l_param; 419 return l_param;
408 } 420 }
409 421
410 } // namespace ui 422 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/ozone/events_ozone.cc ('k') | ui/events/x/events_x.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698