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

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

Issue 419283003: Fix 'repeat' state of a DOM KeyboardEvent on Windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use 0xXXXX for mask, add comment Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9
10 using blink::WebInputEvent; 10 using blink::WebInputEvent;
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 153
154 if (::GetKeyState(VK_SHIFT) & 0x8000) 154 if (::GetKeyState(VK_SHIFT) & 0x8000)
155 result.modifiers |= WebInputEvent::ShiftKey; 155 result.modifiers |= WebInputEvent::ShiftKey;
156 if (::GetKeyState(VK_CONTROL) & 0x8000) 156 if (::GetKeyState(VK_CONTROL) & 0x8000)
157 result.modifiers |= WebInputEvent::ControlKey; 157 result.modifiers |= WebInputEvent::ControlKey;
158 if (::GetKeyState(VK_MENU) & 0x8000) 158 if (::GetKeyState(VK_MENU) & 0x8000)
159 result.modifiers |= WebInputEvent::AltKey; 159 result.modifiers |= WebInputEvent::AltKey;
160 // NOTE: There doesn't seem to be a way to query the mouse button state in 160 // NOTE: There doesn't seem to be a way to query the mouse button state in
161 // this case. 161 // this case.
162 162
163 if (LOWORD(lparam) > 1) 163 // Bit 30 of lParam represents the "previous key state". If set, the key was
164 // already down, therefore this is an auto-repeat.
165 if (lparam & 0x40000000)
164 result.modifiers |= WebInputEvent::IsAutoRepeat; 166 result.modifiers |= WebInputEvent::IsAutoRepeat;
165 167
166 result.modifiers |= GetLocationModifier(wparam, lparam); 168 result.modifiers |= GetLocationModifier(wparam, lparam);
167 169
168 SetToggleKeyState(&result); 170 SetToggleKeyState(&result);
169 return result; 171 return result;
170 } 172 }
171 173
172 // WebMouseEvent -------------------------------------------------------------- 174 // WebMouseEvent --------------------------------------------------------------
173 175
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 result.wheelTicksX = wheel_delta; 454 result.wheelTicksX = wheel_delta;
453 } else { 455 } else {
454 result.deltaY = scroll_delta; 456 result.deltaY = scroll_delta;
455 result.wheelTicksY = wheel_delta; 457 result.wheelTicksY = wheel_delta;
456 } 458 }
457 459
458 return result; 460 return result;
459 } 461 }
460 462
461 } // namespace content 463 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698