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

Unified Diff: ash/accelerators/accelerator_controller.cc

Issue 10452042: Fixing french keyboard handling (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: ash/accelerators/accelerator_controller.cc
diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc
index fa8192731902c46b30ceb9f4b9bfd183d92c1ff0..52b834a81df6e4b9bd133c91b3d1da8387c24d2f 100644
--- a/ash/accelerators/accelerator_controller.cc
+++ b/ash/accelerators/accelerator_controller.cc
@@ -242,6 +242,21 @@ void AcceleratorController::UnregisterAll(ui::AcceleratorTarget* target) {
}
bool AcceleratorController::Process(const ui::Accelerator& accelerator) {
+ // On French keyboards the user needs to press a number key in conjunction
+ // with the shift key. To get the right accelerator from our static table
+ // we modify the received accelerator to match this.
+ if (accelerator.key_code() >= ui::VKEY_0 &&
mazda 2012/05/25 22:52:38 I'm worried about letting AcceleratorController ha
Mr4D (OOO till 08-26) 2012/05/29 14:59:25 Done
+ accelerator.key_code() <= ui::VKEY_9) {
+ // A keyboard layout can get changed by the user, so we need to dynamically
+ // check if a modification is required.
+ if (ime_control_delegate_.get() &&
+ ime_control_delegate_->IsFrenchKeyboard()) {
+ // We toggle the shift key to get the correct accelerator from our table.
+ return accelerator_manager_->Process(
+ ui::Accelerator(accelerator.key_code(),
+ accelerator.modifiers() ^ ui::EF_SHIFT_DOWN));
+ }
+ }
return accelerator_manager_->Process(accelerator);
}
« no previous file with comments | « no previous file | ash/accelerators/accelerator_table.cc » ('j') | chrome/browser/ui/views/ash/ime_controller_chromeos.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698