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

Side by Side Diff: content/browser/renderer_host/web_input_event_aura.cc

Issue 1550953002: Keyboard events with keypad had wrong keycodes on ozone. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 | « no previous file | ui/events/keycodes/keyboard_code_conversion.h » ('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 "content/browser/renderer_host/web_input_event_aura.h" 5 #include "content/browser/renderer_host/web_input_event_aura.h"
6 6
7 #include "content/browser/renderer_host/input/web_input_event_util.h" 7 #include "content/browser/renderer_host/input/web_input_event_util.h"
8 #include "content/browser/renderer_host/ui_events_helper.h" 8 #include "content/browser/renderer_host/ui_events_helper.h"
9 #include "ui/aura/client/screen_position_client.h" 9 #include "ui/aura/client/screen_position_client.h"
10 #include "ui/aura/window.h" 10 #include "ui/aura/window.h"
11 #include "ui/events/blink/blink_event_util.h" 11 #include "ui/events/blink/blink_event_util.h"
12 #include "ui/events/event.h" 12 #include "ui/events/event.h"
13 #include "ui/events/event_utils.h" 13 #include "ui/events/event_utils.h"
14 #include "ui/events/keycodes/dom/keycode_converter.h" 14 #include "ui/events/keycodes/dom/keycode_converter.h"
15 #include "ui/events/keycodes/keyboard_code_conversion.h"
15 16
16 namespace content { 17 namespace content {
17 18
18 namespace { 19 namespace {
19 20
20 gfx::Point GetScreenLocationFromEvent(const ui::LocatedEvent& event) { 21 gfx::Point GetScreenLocationFromEvent(const ui::LocatedEvent& event) {
21 if (!event.target()) 22 if (!event.target())
22 return event.root_location(); 23 return event.root_location();
23 24
24 aura::Window* root = 25 aura::Window* root =
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 case ui::ET_KEY_RELEASED: 79 case ui::ET_KEY_RELEASED:
79 webkit_event.type = blink::WebInputEvent::KeyUp; 80 webkit_event.type = blink::WebInputEvent::KeyUp;
80 break; 81 break;
81 default: 82 default:
82 NOTREACHED(); 83 NOTREACHED();
83 } 84 }
84 85
85 if (webkit_event.modifiers & blink::WebInputEvent::AltKey) 86 if (webkit_event.modifiers & blink::WebInputEvent::AltKey)
86 webkit_event.isSystemKey = true; 87 webkit_event.isSystemKey = true;
87 88
88 webkit_event.windowsKeyCode = event.key_code(); 89 // TODO(dtapuska): crbug.com/570388. Ozone appears to deliver
90 // key_code events that aren't "located" for the keypad like
91 // Windows and X11 do and blink expects.
92 webkit_event.windowsKeyCode =
93 ui::NonLocatedToLocatedKeypadKeyboardCode(event.key_code(), event.code());
89 webkit_event.nativeKeyCode = 94 webkit_event.nativeKeyCode =
90 ui::KeycodeConverter::DomCodeToNativeKeycode(event.code()); 95 ui::KeycodeConverter::DomCodeToNativeKeycode(event.code());
91 webkit_event.domCode = static_cast<int>(event.code()); 96 webkit_event.domCode = static_cast<int>(event.code());
92 webkit_event.domKey = static_cast<int>(event.GetDomKey()); 97 webkit_event.domKey = static_cast<int>(event.GetDomKey());
93 webkit_event.unmodifiedText[0] = event.GetUnmodifiedText(); 98 webkit_event.unmodifiedText[0] = event.GetUnmodifiedText();
94 webkit_event.text[0] = event.GetText(); 99 webkit_event.text[0] = event.GetText();
95 100
96 webkit_event.setKeyIdentifierFromWindowsKeyCode(); 101 webkit_event.setKeyIdentifierFromWindowsKeyCode();
97 102
98 return webkit_event; 103 return webkit_event;
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 webkit_event.tiltX = roundf(event.pointer_details().tilt_x()); 419 webkit_event.tiltX = roundf(event.pointer_details().tilt_x());
415 webkit_event.tiltY = roundf(event.pointer_details().tilt_y()); 420 webkit_event.tiltY = roundf(event.pointer_details().tilt_y());
416 webkit_event.force = event.pointer_details().force(); 421 webkit_event.force = event.pointer_details().force();
417 webkit_event.pointerType = 422 webkit_event.pointerType =
418 EventPointerTypeToWebPointerType(event.pointer_details().pointer_type()); 423 EventPointerTypeToWebPointerType(event.pointer_details().pointer_type());
419 424
420 return webkit_event; 425 return webkit_event;
421 } 426 }
422 427
423 } // namespace content 428 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | ui/events/keycodes/keyboard_code_conversion.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698