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

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

Issue 23890039: Do not rewrite AltGr Key as Alt+Ctrl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove HTML file Created 7 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 (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/render_widget_host_view_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 2627 matching lines...) Expand 10 before | Expand all | Expand 10 after
2638 event->SetHandled(); 2638 event->SetHandled();
2639 return; 2639 return;
2640 } 2640 }
2641 } 2641 }
2642 } 2642 }
2643 if (!in_shutdown_) { 2643 if (!in_shutdown_) {
2644 in_shutdown_ = true; 2644 in_shutdown_ = true;
2645 host_->Shutdown(); 2645 host_->Shutdown();
2646 } 2646 }
2647 } else { 2647 } else {
2648 // Windows does not have a specific key code for AltGr and sends
2649 // left-Control and right-Alt when the AltGr key is pressed. Also
2650 // Windows translates AltGr modifier to Ctrl+Alt modifier. To be compatible
2651 // with this behavior, we re-write keyboard event from AltGr to Alt + Ctrl
2652 // key event here.
2653 if (event->key_code() == ui::VKEY_ALTGR) {
2654 // Synthesize Ctrl & Alt events.
2655 NativeWebKeyboardEvent ctrl_webkit_event(
2656 event->type(),
2657 false,
2658 ui::VKEY_CONTROL,
2659 event->flags(),
2660 ui::EventTimeForNow().InSecondsF());
2661 host_->ForwardKeyboardEvent(ctrl_webkit_event);
2662
2663 NativeWebKeyboardEvent alt_webkit_event(
2664 event->type(),
2665 false,
2666 ui::VKEY_MENU,
2667 event->flags(),
2668 ui::EventTimeForNow().InSecondsF());
2669 host_->ForwardKeyboardEvent(alt_webkit_event);
2670 event->SetHandled();
2671 return;
2672 }
2673
2674 // We don't have to communicate with an input method here. 2648 // We don't have to communicate with an input method here.
2675 if (!event->HasNativeEvent()) { 2649 if (!event->HasNativeEvent()) {
2676 NativeWebKeyboardEvent webkit_event( 2650 NativeWebKeyboardEvent webkit_event(
2677 event->type(), 2651 event->type(),
2678 event->is_char(), 2652 event->is_char(),
2679 event->is_char() ? event->GetCharacter() : event->key_code(), 2653 event->is_char() ? event->GetCharacter() : event->key_code(),
2680 event->flags(), 2654 event->flags(),
2681 ui::EventTimeForNow().InSecondsF()); 2655 ui::EventTimeForNow().InSecondsF());
2682 host_->ForwardKeyboardEvent(webkit_event); 2656 host_->ForwardKeyboardEvent(webkit_event);
2683 } else { 2657 } else {
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after
3374 RenderWidgetHost* widget) { 3348 RenderWidgetHost* widget) {
3375 return new RenderWidgetHostViewAura(widget); 3349 return new RenderWidgetHostViewAura(widget);
3376 } 3350 }
3377 3351
3378 // static 3352 // static
3379 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { 3353 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) {
3380 GetScreenInfoForWindow(results, NULL); 3354 GetScreenInfoForWindow(results, NULL);
3381 } 3355 }
3382 3356
3383 } // namespace content 3357 } // namespace content
OLDNEW
« no previous file with comments | « chrome/test/data/textinput/keyevent_logging.html ('k') | content/browser/renderer_host/ui_events_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698