Commit da5a4850 authored by grt's avatar grt Committed by Commit bot

Revert of Fix CapsLock remapping. (patchset #2 id:20001 of...

Revert of Fix CapsLock remapping. (patchset #2 id:20001 of https://codereview.chromium.org/959923002/)

Reason for revert:
EventConverterEvdevImplTest.KeyWithLock failing consistently on Linux ChromiumOS Ozone Tests (1).

Original issue's description:
> Fix CapsLock remapping.
>
> Emulates the ChromeOS/X11 method of using F16 and Mod3 to
> represent the caps lock key before remapping.
>
> BUG=461485
> TEST=On device with external keyboard
>
> Committed: https://crrev.com/5fdc45c765de00dd9143879864fa57c7d133e309
> Cr-Commit-Position: refs/heads/master@{#318240}

TBR=spang@chromium.org,derat@chromium.org,kpschoedel@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=461485

Review URL: https://codereview.chromium.org/965473002

Cr-Commit-Position: refs/heads/master@{#318278}
parent 929aa683
......@@ -23,7 +23,6 @@ static const int kEventFlagFromModifiers[] = {
EF_RIGHT_MOUSE_BUTTON, // EVDEV_MODIFIER_RIGHT_MOUSE_BUTTON
EF_COMMAND_DOWN, // EVDEV_MODIFIER_COMMAND
EF_ALTGR_DOWN, // EVDEV_MODIFIER_ALTGR
EF_MOD3_DOWN, // EVDEV_MODIFIER_MOD3
};
} // namespace
......
......@@ -21,7 +21,6 @@ enum {
EVDEV_MODIFIER_RIGHT_MOUSE_BUTTON,
EVDEV_MODIFIER_COMMAND,
EVDEV_MODIFIER_ALTGR,
EVDEV_MODIFIER_MOD3,
EVDEV_NUM_MODIFIERS
};
......
......@@ -46,6 +46,10 @@ int EventFlagToEvdevModifier(int flag) {
}
}
bool IsModifierLock(int evdev_modifier) {
return evdev_modifier == EVDEV_MODIFIER_CAPS_LOCK;
}
} // namespace
KeyboardEvdev::KeyboardEvdev(EventModifiersEvdev* modifiers,
......@@ -118,15 +122,8 @@ void KeyboardEvdev::UpdateModifier(int modifier_flag, bool down) {
if (modifier == EVDEV_MODIFIER_NONE)
return;
// TODO post-X11: Revise remapping to not use EF_MOD3_DOWN.
// Currently EF_MOD3_DOWN means that the CapsLock key is currently down,
// and EF_CAPS_LOCK_DOWN means the caps lock state is enabled (and the
// key may or may not be down, but usually isn't). There does need to
// to be two different flags, since the physical CapsLock key is subject
// to remapping, but the caps lock state (which can be triggered in a
// variety of ways) is not.
if (modifier == EVDEV_MODIFIER_CAPS_LOCK)
modifiers_->UpdateModifier(EVDEV_MODIFIER_MOD3, down);
if (IsModifierLock(modifier))
modifiers_->UpdateModifierLock(modifier, down);
else
modifiers_->UpdateModifier(modifier, down);
}
......
......@@ -546,10 +546,6 @@ int ModifierDomKeyToEventFlag(DomKey key) {
return EF_ALT_DOWN;
case DomKey::ALT_GRAPH:
return EF_ALTGR_DOWN;
// ChromeOS uses F16 to represent CapsLock before the rewriting stage,
// based on the historical X11 implementation.
// TODO post-X11: Switch to use CapsLock uniformly.
case DomKey::F16:
case DomKey::CAPS_LOCK:
return EF_CAPS_LOCK_DOWN;
case DomKey::CONTROL:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment