mirror of
https://github.com/keymanapp/keyman.git
synced 2026-10-06 14:07:32 +00:00
Apply suggestions from code review
Co-authored-by: Marc Durdin <marc@durdin.net>
This commit is contained in:
parent
1b04772bb9
commit
4d644cd00e
1 changed files with 7 additions and 2 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue