From 018016907defe00bf2e9531e75a77c33fb370ed3 Mon Sep 17 00:00:00 2001 From: jahorton Date: Mon, 12 Jul 2021 05:32:13 +0700 Subject: [PATCH] chore(web): another PR suggestion --- .../web/input-processor/src/text/inputProcessor.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/common/core/web/input-processor/src/text/inputProcessor.ts b/common/core/web/input-processor/src/text/inputProcessor.ts index 314d1e8c5e..e2607cfd7d 100644 --- a/common/core/web/input-processor/src/text/inputProcessor.ts +++ b/common/core/web/input-processor/src/text/inputProcessor.ts @@ -78,9 +78,13 @@ namespace com.keyman.text { } // Will handle keystroke-based non-layer change modifier & state keys, mapping them through the physical keyboard's version - // of state management. - if(!fromOSK && this.keyboardProcessor.doModifierPress(keyEvent, !fromOSK)) { - return new RuleBehavior(); + // of state management. `doModifierPress` must always run. + if(this.keyboardProcessor.doModifierPress(keyEvent, !fromOSK)) { + // If run on a desktop platform, we know that modifier & state key presses may not + // produce output, so we may make an immediate return safely. + if(!fromOSK) { + return new RuleBehavior(); + } } // If suggestions exist AND space is pressed, accept the suggestion and do not process the keystroke.