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

Unified Diff: chrome/browser/chromeos/events/event_rewriter.cc

Issue 277443004: Handle X11 Mod3Mask for Caps Lock remapping. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update unit tests with Mod3Mask Created 6 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/events/event_rewriter_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/events/event_rewriter.cc
diff --git a/chrome/browser/chromeos/events/event_rewriter.cc b/chrome/browser/chromeos/events/event_rewriter.cc
index c2518897d248cb405734c8f3163bfee56f547dd6..0dbd4fc6e597441f41fd748101a3562ff0a4327b 100644
--- a/chrome/browser/chromeos/events/event_rewriter.cc
+++ b/chrome/browser/chromeos/events/event_rewriter.cc
@@ -68,7 +68,7 @@ const struct ModifierRemapping {
{input_method::kAltKey, ui::EF_ALT_DOWN, ui::VKEY_MENU,
prefs::kLanguageRemapAltKeyTo},
{input_method::kVoidKey, 0, ui::VKEY_UNKNOWN, NULL},
- {input_method::kCapsLockKey, ui::EF_CAPS_LOCK_DOWN, ui::VKEY_CAPITAL,
+ {input_method::kCapsLockKey, ui::EF_MOD3_DOWN, ui::VKEY_CAPITAL,
prefs::kLanguageRemapCapsLockKeyTo},
{input_method::kEscapeKey, 0, ui::VKEY_ESCAPE, NULL},
{0, 0, ui::VKEY_F15, prefs::kLanguageRemapDiamondKeyTo},
@@ -325,11 +325,16 @@ int EventRewriter::GetRemappedModifierMasks(const PrefService& pref_service,
remapped_key = kModifierRemappingCtrl;
}
break;
- case ui::EF_CAPS_LOCK_DOWN:
- // If CapsLock is used by the current input method, don't allow the
- // CapsLock pref to remap it, or the keyboard behavior will be broken.
+ case ui::EF_MOD3_DOWN:
+ // If EF_MOD3_DOWN is used by the current input method, leave it alone;
+ // it is not remappable.
if (IsISOLevel5ShiftUsedByCurrentInputMethod())
continue;
+ // Otherwise, Mod3Mask is set on X events when the Caps Lock key
+ // is down, but, if Caps Lock is remapped, CapsLock is NOT set,
+ // because pressing the key does not invoke caps lock. So, the
+ // kModifierRemappings[] table uses EF_MOD3_DOWN for the Caps
+ // Lock remapping.
break;
default:
break;
« no previous file with comments | « no previous file | chrome/browser/chromeos/events/event_rewriter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698