diff --git a/web/src/engine/src/main/headless/inputProcessor.ts b/web/src/engine/src/main/headless/inputProcessor.ts index f8bc1725ba..88168a54f4 100644 --- a/web/src/engine/src/main/headless/inputProcessor.ts +++ b/web/src/engine/src/main/headless/inputProcessor.ts @@ -172,7 +172,11 @@ export class InputProcessor { // The default OSK layout for desktop devices does not include nextlayer info, relying on // modifier detection here. // It's the OSK equivalent to doModifierPress on 'desktop' form factors. - if ((formFactor == DeviceSpec.FormFactor.Desktop || !this.activeKeyboard || (this.activeKeyboard instanceof JSKeyboard && this.activeKeyboard.usesDesktopLayoutOnDevice(keyEvent.device))) && keyEvent.isSynthetic) { + if ((formFactor == DeviceSpec.FormFactor.Desktop || !this.activeKeyboard || + (this.activeKeyboard instanceof JSKeyboard && + this.activeKeyboard.usesDesktopLayoutOnDevice(keyEvent.device))) && + keyEvent.isSynthetic + ) { // If it's a desktop OSK style and this triggers a layer change, // a modifier key was clicked. No output expected, so it's safe to instantly exit. if (this.keyboardProcessor.selectLayer(keyEvent)) { @@ -182,7 +186,8 @@ export class InputProcessor { // 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. - if (this.keyboardProcessor.doModifierPress(keyEvent, textStore, !keyEvent.isSynthetic) && !keyEvent.isSynthetic) { + const wasModifierPress = this.keyboardProcessor.doModifierPress(keyEvent, textStore, !keyEvent.isSynthetic); + if (wasModifierPress && !keyEvent.isSynthetic) { // 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. return new ProcessorAction();