From 6c80da3fc30199192e4ff9d1077078f0f2a6ae5c Mon Sep 17 00:00:00 2001 From: "Joshua A. Horton" Date: Wed, 6 Jul 2022 13:20:14 +0700 Subject: [PATCH] fix(web): doModifierPress layer handling --- common/core/web/input-processor/src/text/inputProcessor.ts | 5 ++--- .../web/keyboard-processor/src/text/keyboardProcessor.ts | 6 ++++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/common/core/web/input-processor/src/text/inputProcessor.ts b/common/core/web/input-processor/src/text/inputProcessor.ts index f1d877e294..bbf61f7e80 100644 --- a/common/core/web/input-processor/src/text/inputProcessor.ts +++ b/common/core/web/input-processor/src/text/inputProcessor.ts @@ -103,9 +103,8 @@ 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. `doModifierPress` must always run for desktop-mode contexts. - // In standard Web integration, `contextDevice` indicates what type of OSK is visible. - if(!this.contextDevice.touchable && this.keyboardProcessor.doModifierPress(keyEvent, outputTarget, !fromOSK)) { + // of state management. `doModifierPress` must always run. + if(this.keyboardProcessor.doModifierPress(keyEvent, outputTarget, !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) { diff --git a/common/core/web/keyboard-processor/src/text/keyboardProcessor.ts b/common/core/web/keyboard-processor/src/text/keyboardProcessor.ts index 6eddc09c33..294f9180a9 100644 --- a/common/core/web/keyboard-processor/src/text/keyboardProcessor.ts +++ b/common/core/web/keyboard-processor/src/text/keyboardProcessor.ts @@ -731,7 +731,7 @@ namespace com.keyman.text { } else if(KeyboardProcessor.isModifier(Levent)) { this.activeKeyboard.notify(Levent.Lcode, outputTarget, isKeyDown ? 1 : 0); // For eventual integration - we bypass an OSK update for physical keystrokes when in touch mode. - if(!Levent.device.touchable) { + if(!this.contextDevice.touchable) { return this._UpdateVKShift(Levent); // I2187 } else { return true; @@ -740,7 +740,9 @@ namespace com.keyman.text { if(Levent.LmodifierChange) { this.activeKeyboard.notify(0, outputTarget, 1); - this._UpdateVKShift(Levent); + if(!this.contextDevice.touchable) { + this._UpdateVKShift(Levent); + } } // No modifier keypresses detected.