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

Side by Side Diff: content/browser/renderer_host/input/web_input_event_builders_win.cc

Issue 1308063007: Generate non-located windowsKeyCode for the WebInputEvents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unittests Created 5 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/browser/renderer_host/input/web_input_event_builders_win.h" 5 #include "content/browser/renderer_host/input/web_input_event_builders_win.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "content/browser/renderer_host/input/web_input_event_util.h" 8 #include "content/browser/renderer_host/input/web_input_event_util.h"
9 #include "ui/gfx/win/dpi.h" 9 #include "ui/gfx/win/dpi.h"
10 10
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 break; 62 break;
63 default: 63 default:
64 NOTREACHED(); 64 NOTREACHED();
65 } 65 }
66 66
67 if (result.type == WebInputEvent::Char 67 if (result.type == WebInputEvent::Char
68 || result.type == WebInputEvent::RawKeyDown) { 68 || result.type == WebInputEvent::RawKeyDown) {
69 result.text[0] = result.windowsKeyCode; 69 result.text[0] = result.windowsKeyCode;
70 result.unmodifiedText[0] = result.windowsKeyCode; 70 result.unmodifiedText[0] = result.windowsKeyCode;
71 } 71 }
72 if (result.type != WebInputEvent::Char) { 72 if (result.type != WebInputEvent::Char)
73 UpdateWindowsKeyCodeAndKeyIdentifier( 73 result.setKeyIdentifierFromWindowsKeyCode();
74 &result,
75 static_cast<ui::KeyboardCode>(result.windowsKeyCode));
76 }
77 74
78 if (::GetKeyState(VK_SHIFT) & 0x8000) 75 if (::GetKeyState(VK_SHIFT) & 0x8000)
79 result.modifiers |= WebInputEvent::ShiftKey; 76 result.modifiers |= WebInputEvent::ShiftKey;
80 if (::GetKeyState(VK_CONTROL) & 0x8000) 77 if (::GetKeyState(VK_CONTROL) & 0x8000)
81 result.modifiers |= WebInputEvent::ControlKey; 78 result.modifiers |= WebInputEvent::ControlKey;
82 if (::GetKeyState(VK_MENU) & 0x8000) 79 if (::GetKeyState(VK_MENU) & 0x8000)
83 result.modifiers |= WebInputEvent::AltKey; 80 result.modifiers |= WebInputEvent::AltKey;
84 // NOTE: There doesn't seem to be a way to query the mouse button state in 81 // NOTE: There doesn't seem to be a way to query the mouse button state in
85 // this case. 82 // this case.
86 83
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 result.wheelTicksX = wheel_delta; 378 result.wheelTicksX = wheel_delta;
382 } else { 379 } else {
383 result.deltaY = scroll_delta; 380 result.deltaY = scroll_delta;
384 result.wheelTicksY = wheel_delta; 381 result.wheelTicksY = wheel_delta;
385 } 382 }
386 383
387 return result; 384 return result;
388 } 385 }
389 386
390 } // namespace content 387 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698