From d0abbb1f2eaccf6b43531f4010a7c99a154f04c3 Mon Sep 17 00:00:00 2001 From: Nurhan Turgut <50856934+nturgut@users.noreply.github.com> Date: Tue, 10 Dec 2019 14:55:46 -0800 Subject: [PATCH] Fix for tab not working (flutter/engine#14165) * some logs * Masking moddifier state for lock keys if the key code is not the same as the modifier. this fixes tab issue happening when numlock/capslock is on. * removing modifier state for locks * addresing pr comments' --- .../lib/web_ui/lib/src/engine/keyboard.dart | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/engine/src/flutter/lib/web_ui/lib/src/engine/keyboard.dart b/engine/src/flutter/lib/web_ui/lib/src/engine/keyboard.dart index 9b3314ed8f..4cf743fda8 100644 --- a/engine/src/flutter/lib/web_ui/lib/src/engine/keyboard.dart +++ b/engine/src/flutter/lib/web_ui/lib/src/engine/keyboard.dart @@ -117,9 +117,6 @@ const int _modifierShift = 0x01; const int _modifierAlt = 0x02; const int _modifierControl = 0x04; const int _modifierMeta = 0x08; -const int _modifierNumLock = 0x10; -const int _modifierCapsLock = 0x20; -const int _modifierScrollLock = 0x40; /// Creates a bitmask representing the meta state of the [event]. int _getMetaState(html.KeyboardEvent event) { @@ -136,15 +133,8 @@ int _getMetaState(html.KeyboardEvent event) { if (event.getModifierState('Meta')) { metaState |= _modifierMeta; } - if (event.getModifierState('NumLock')) { - metaState |= _modifierNumLock; - } - if (event.getModifierState('CapsLock')) { - metaState |= _modifierCapsLock; - } - if (event.getModifierState('ScrollLock')) { - metaState |= _modifierScrollLock; - } + // TODO: Re-enable lock key modifiers once there is support on Flutter + // Framework. https://github.com/flutter/flutter/issues/46718 return metaState; }