Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/chromeos/events/event_rewriter.h" | 5 #include "chrome/browser/chromeos/events/event_rewriter.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "ash/sticky_keys/sticky_keys_controller.h" | 9 #include "ash/sticky_keys/sticky_keys_controller.h" |
| 10 #include "ash/wm/window_state.h" | 10 #include "ash/wm/window_state.h" |
| (...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 630 // F15 is not a modifier key, so we need to track its state directly. | 630 // F15 is not a modifier key, so we need to track its state directly. |
| 631 if (key_event.type() == ui::ET_KEY_PRESSED) { | 631 if (key_event.type() == ui::ET_KEY_PRESSED) { |
| 632 int remapped_flag = remapped_key->flag; | 632 int remapped_flag = remapped_key->flag; |
| 633 if (remapped_key->remap_to == input_method::kCapsLockKey) | 633 if (remapped_key->remap_to == input_method::kCapsLockKey) |
| 634 remapped_flag |= ui::EF_CAPS_LOCK_DOWN; | 634 remapped_flag |= ui::EF_CAPS_LOCK_DOWN; |
| 635 current_diamond_key_modifier_flags_ = remapped_flag; | 635 current_diamond_key_modifier_flags_ = remapped_flag; |
| 636 } else { | 636 } else { |
| 637 current_diamond_key_modifier_flags_ = ui::EF_NONE; | 637 current_diamond_key_modifier_flags_ = ui::EF_NONE; |
| 638 } | 638 } |
| 639 break; | 639 break; |
| 640 // On Chrome OS, XF86XK_Launch7 (F16) with Mod3Mask is sent when Caps Lock | 640 // On X11 Chrome OS, XF86XK_Launch7 (F16) with Mod3Mask is sent when Caps |
| 641 // is pressed (with one exception: when | 641 // Lock is pressed (with one exception: when |
| 642 // IsISOLevel5ShiftUsedByCurrentInputMethod() is true, the key generates | 642 // IsISOLevel5ShiftUsedByCurrentInputMethod() is true, the key generates |
| 643 // XK_ISO_Level3_Shift with Mod3Mask, not XF86XK_Launch7). | 643 // XK_ISO_Level3_Shift with Mod3Mask, not XF86XK_Launch7). |
|
Daniel Erat
2015/02/25 22:13:45
does this comment need to be updated to describe w
kpschoedel
2015/02/25 23:03:06
Using spang's suggestion & removing this file from
| |
| 644 case ui::VKEY_F16: | 644 case ui::VKEY_F16: |
| 645 case ui::VKEY_CAPITAL: | |
| 645 characteristic_flag = ui::EF_CAPS_LOCK_DOWN; | 646 characteristic_flag = ui::EF_CAPS_LOCK_DOWN; |
| 646 remapped_key = | 647 remapped_key = |
| 647 GetRemappedKey(prefs::kLanguageRemapCapsLockKeyTo, *pref_service); | 648 GetRemappedKey(prefs::kLanguageRemapCapsLockKeyTo, *pref_service); |
| 648 break; | 649 break; |
| 649 case ui::VKEY_LWIN: | 650 case ui::VKEY_LWIN: |
| 650 case ui::VKEY_RWIN: | 651 case ui::VKEY_RWIN: |
| 651 characteristic_flag = ui::EF_COMMAND_DOWN; | 652 characteristic_flag = ui::EF_COMMAND_DOWN; |
| 652 // Rewrite Command-L/R key presses on an Apple keyboard to Control. | 653 // Rewrite Command-L/R key presses on an Apple keyboard to Control. |
| 653 if (IsAppleKeyboard()) { | 654 if (IsAppleKeyboard()) { |
| 654 DCHECK_EQ(ui::VKEY_CONTROL, kModifierRemappingCtrl->key_code); | 655 DCHECK_EQ(ui::VKEY_CONTROL, kModifierRemappingCtrl->key_code); |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 999 // TODO(spang): Figure out where we can get keyboard vendor/product id from in | 1000 // TODO(spang): Figure out where we can get keyboard vendor/product id from in |
| 1000 // Ozone/Freon version. | 1001 // Ozone/Freon version. |
| 1001 return KeyboardDeviceAddedInternal(device_id, | 1002 return KeyboardDeviceAddedInternal(device_id, |
| 1002 "keyboard", | 1003 "keyboard", |
| 1003 kUnknownVendorId, | 1004 kUnknownVendorId, |
| 1004 kUnknownProductId); | 1005 kUnknownProductId); |
| 1005 #endif | 1006 #endif |
| 1006 } | 1007 } |
| 1007 | 1008 |
| 1008 } // namespace chromeos | 1009 } // namespace chromeos |
| OLD | NEW |