From dcedb15b692b65e372bb7e0ccf87ce1cd94f5555 Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Tue, 23 Nov 2021 16:08:19 +1100 Subject: [PATCH] chore: cleanup comments and defines --- common/core/desktop/src/kmx/kmx_file.h | 19 ++++++++++++++++++- .../src/text/inputProcessor.ts | 10 +++++----- .../KeymanEngine4Mac/KME/KMBinaryFileFormat.h | 12 +++++++++++- web/source/dom/domEventHandlers.ts | 5 ++--- 4 files changed, 36 insertions(+), 10 deletions(-) diff --git a/common/core/desktop/src/kmx/kmx_file.h b/common/core/desktop/src/kmx/kmx_file.h index 5771b19999..13f60917c8 100644 --- a/common/core/desktop/src/kmx/kmx_file.h +++ b/common/core/desktop/src/kmx/kmx_file.h @@ -110,6 +110,8 @@ namespace kmx { #define TSS_COMPARISON 30 +#define TSS__KEYMAN_80_MAX 30 + /* Keyman 9.0 system stores */ #define TSS_PLATFORM 31 @@ -126,7 +128,22 @@ namespace kmx { #define TSS_TARGETS 38 -#define TSS__MAX 38 +#define TSS__KEYMAN_90_MAX 38 + +/* Keyman 14.0 system stores */ + +#define TSS_CASEDKEYS 39 + +#define TSS__KEYMAN_140_MAX 39 + +/* Keyman 15.0 system stores */ + +#define TSS_BEGIN_NEWCONTEXT 40 +#define TSS_BEGIN_POSTKEYSTROKE 41 + +#define TSS__KEYMAN_150_MAX 41 + +#define TSS__MAX 41 /* wm_keyman_control_internal message control codes */ diff --git a/common/core/web/input-processor/src/text/inputProcessor.ts b/common/core/web/input-processor/src/text/inputProcessor.ts index d67bb7687f..04a4ad9c0b 100644 --- a/common/core/web/input-processor/src/text/inputProcessor.ts +++ b/common/core/web/input-processor/src/text/inputProcessor.ts @@ -53,16 +53,16 @@ namespace com.keyman.text { } /** + * Tell the currently active keyboard that a new context has been selected, + * e.g. by focus change, selection change, keyboard change, etc. * - * @param outputTarget - * @returns + * @param {Object} outputTarget The OutputTarget that has focus + * @returns {Object} A RuleBehavior object describing the cumulative effects of + * all matched keyboard rules */ processNewContextEvent(outputTarget: OutputTarget): RuleBehavior { - // We presently need the true keystroke to run on the FULL context. That index is still - // needed for some indexing operations when comparing two different output targets. const ruleBehavior = this.keyboardProcessor.processNewContextEvent(this.device, outputTarget); - // Should we swallow any further processing of keystroke events for this? if(ruleBehavior != null) { ruleBehavior.finalize(this.keyboardProcessor, outputTarget); } diff --git a/mac/KeymanEngine4Mac/KeymanEngine4Mac/KME/KMBinaryFileFormat.h b/mac/KeymanEngine4Mac/KeymanEngine4Mac/KME/KMBinaryFileFormat.h index 0f4614c1c9..23beb9716d 100644 --- a/mac/KeymanEngine4Mac/KeymanEngine4Mac/KME/KMBinaryFileFormat.h +++ b/mac/KeymanEngine4Mac/KeymanEngine4Mac/KME/KMBinaryFileFormat.h @@ -98,6 +98,7 @@ struct COMP_STORE { #define TSS__KEYMAN_70_MAX 29 /* Keyman 8.0 system stores */ #define TSS_COMPARISON 30 +#define TSS__KEYMAN_80_MAX 30 /* Keyman 9.0 system stores */ #define TSS_PLATFORM 31 #define TSS_BASELAYOUT 32 @@ -109,7 +110,16 @@ struct COMP_STORE { #define TSS_KEYBOARDVERSION 36 // &keyboardversion system store // I4140 #define TSS_KMW_EMBEDCSS 37 #define TSS_TARGETS 38 -#define TSS__MAX 38 +#define TSS__KEYMAN_90_MAX 38 +/* Keyman 14.0 system stores */ +#define TSS_CASEDKEYS 39 +#define TSS__KEYMAN_140_MAX 39 +/* Keyman 15.0 system stores */ +#define TSS_BEGIN_NEWCONTEXT 40 +#define TSS_BEGIN_POSTKEYSTROKE 41 +#define TSS__KEYMAN_150_MAX 41 + +#define TSS__MAX 41 // ShiftFlags #define LCTRLFLAG 0x0001 // Left Control flag diff --git a/web/source/dom/domEventHandlers.ts b/web/source/dom/domEventHandlers.ts index ae586a73d6..067ca2c6ee 100644 --- a/web/source/dom/domEventHandlers.ts +++ b/web/source/dom/domEventHandlers.ts @@ -355,11 +355,10 @@ namespace com.keyman.dom { DOMEventHandlers.states._SelectionControl = target; if(target && outputTarget) { - // // Call the current keyboard's newContext handler; // timeout is required in order to get the current - // selection, swhich is not ready at time of focus event - // + // selection, which is not ready at time of focus event, + // at least on Chrome window.setTimeout(() => { //console.log('processNewContextEvent called from focus'); com.keyman.singleton.core.processNewContextEvent(outputTarget);