From cd276286524f95bb7388d6794313ead442cef7d2 Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Sat, 23 Sep 2023 10:31:40 +0700 Subject: [PATCH 01/18] chore(developer): Add non-printing characters --- .../src/tike/xml/layoutbuilder/constants.js | 35 +++++++++++++++---- 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/developer/src/tike/xml/layoutbuilder/constants.js b/developer/src/tike/xml/layoutbuilder/constants.js index d79850bc23a..117020e5d51 100644 --- a/developer/src/tike/xml/layoutbuilder/constants.js +++ b/developer/src/tike/xml/layoutbuilder/constants.js @@ -551,8 +551,8 @@ $(function() { } this.lookupKeyNames.sort(); - // Defines the PUA code mapping for the various 'special' modifier/control keys on keyboards. - // This is lifted directly from visualKeyboard.ts and must be kept in sync. See also CompileKeymanWeb.pas: CSpecialText10 + // Defines the PUA code mapping for the various 'special' modifier/control/non-printing keys on keyboards. + // This is lifted directly from specialCharacters.ts and must be kept in sync. See also CompileKeymanWeb.pas: CSpecialText10 this.specialCharacters = { '*Shift*': 8, '*Enter*': 5, @@ -586,7 +586,9 @@ $(function() { '*RAltShift*': 0x68, '*LCtrlShift*': 0x69, '*RCtrlShift*': 0x70, - // Following codes introduced in Keyman 14.0 + // Added in Keyman 14.0 + '*LTREnter*': 0x05, // Default alias of '*Enter*'. + '*LTRBkSp*': 0x04, // Default alias of '*BkSp*'. '*RTLEnter*': 0x71, '*RTLBkSp*': 0x72, '*ShiftLock*': 0x73, @@ -594,8 +596,29 @@ $(function() { '*ZWNJ*': 0x75, // * If this one is specified, auto-detection will kick in. '*ZWNJiOS*': 0x75, // The iOS version will be used by default, but the '*ZWNJAndroid*': 0x76, // Android platform has its own default glyph. - '*LTREnter*': 5, // * Forces LTR shaping for the Enter/BkSp keys regardless - '*LTRBkSp*': 4, // of layout's directionality. + // Added in Keyman 17.0. + // Reference: https://github.com/silnrsi/font-symchar/blob/v4.000/documentation/encoding.md + '*ZWNJGeneric*': 0x79, // Generic version of ZWNJ (no override) + '*Sp*': 0x80, // Space + '*NBSp*': 0x82, // No-break Space + '*NarNBSp*': 0x83, // Narrow No-break Space + '*EnQ*': 0x84, // En Quad + '*EmQ*': 0x85, // Em Quad + '*EnSp*': 0x86, // En Space + '*EmSp*': 0x87, // Em Space + // TODO: Skipping #-per-em-space + '*PunctSp*': 0x8c, // Punctuation Space + '*ThSp*': 0x8d, // Thin Space + '*HSp*': 0x8e, // Hair Space + '*ZWSp*': 0x81, // Zero Width Space + '*ZWJ*': 0x77, // Zero Width Joiner + '*WJ*': 0x78, // Word Joiner + '*CGJ*': 0x7a, // Combining Grapheme Joiner + '*LTRM*': 0x90, // Left-to-right Mark + '*RTLM*': 0x91, // Right-to-left Mark + '*SH*': 0xa1, // Soft Hyphen + '*HTab*': 0xa2, // Horizontal Tabulation + // TODO: Skipping size references }; this.specialKeyNames = Object.entries(this.specialCharacters).map(ch => ch[0]); @@ -711,4 +734,4 @@ $(function() { return r; }; -}.bind(builder)); \ No newline at end of file +}.bind(builder)); From bf0a0938a84b895b70ff0d71267a40a31b630231 Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Wed, 25 Oct 2023 14:44:48 +0700 Subject: [PATCH 02/18] chore(developer): Add handling for new characters --- .../src/kmw-compiler/compiler-globals.ts | 4 +++ .../src/kmc-kmn/src/kmw-compiler/constants.ts | 9 ++++++- .../src/kmw-compiler/validate-layout-file.ts | 26 ++++++++++++++++--- 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/developer/src/kmc-kmn/src/kmw-compiler/compiler-globals.ts b/developer/src/kmc-kmn/src/kmw-compiler/compiler-globals.ts index 26981f5711c..92cba914c5e 100644 --- a/developer/src/kmc-kmn/src/kmw-compiler/compiler-globals.ts +++ b/developer/src/kmc-kmn/src/kmw-compiler/compiler-globals.ts @@ -46,3 +46,7 @@ export function IsKeyboardVersion14OrLater(): boolean { export function IsKeyboardVersion15OrLater(): boolean { return fk.fileVersion >= KMX.KMXFile.VERSION_150; } + +export function IsKeyboardVersion17OrLater(): boolean { + return fk.fileVersion >= KMX.KMXFile.VERSION_170; +} diff --git a/developer/src/kmc-kmn/src/kmw-compiler/constants.ts b/developer/src/kmc-kmn/src/kmw-compiler/constants.ts index 55bae9fdb90..a8d88538843 100644 --- a/developer/src/kmc-kmn/src/kmw-compiler/constants.ts +++ b/developer/src/kmc-kmn/src/kmw-compiler/constants.ts @@ -21,7 +21,14 @@ export const ['*ShiftedLock*', '*Shifted*'], ['*ZWNJ*', '<|>'], ['*ZWNJiOS*', '<|>'], - ['*ZWNJAndroid*', '<|>'] + ['*ZWNJAndroid*', '<|>'], + ], + // these names were added in Keyman 17 + CSpecialText17: string = '*Sp*\0*NBSp*\0*NarNBSp*\0*EnQ*\0*EmQ*\0*EnSp*\0*EmSp*\0*PunctSp*\0' + + '*ThSp*\0*HSp*\0*ZWSp*\0*ZWJ*\0*WJ*\0*CGJ*\0*LTRM*\0*RTLM*\0*SH*\0*HTab*\0', + CSpecialText17ZWNJ: string = '*ZWNJGeneric*', + CSpecialText17Map: string[][] = [ + ['*ZWNJGeneric*', '<|>'] ]; diff --git a/developer/src/kmc-kmn/src/kmw-compiler/validate-layout-file.ts b/developer/src/kmc-kmn/src/kmw-compiler/validate-layout-file.ts index 6a28c38b477..7a1ee1842c4 100644 --- a/developer/src/kmc-kmn/src/kmw-compiler/validate-layout-file.ts +++ b/developer/src/kmc-kmn/src/kmw-compiler/validate-layout-file.ts @@ -1,7 +1,7 @@ import { KMX, Osk, TouchLayout, TouchLayoutFileReader, TouchLayoutFileWriter } from "@keymanapp/common-types"; -import { callbacks, IsKeyboardVersion14OrLater, IsKeyboardVersion15OrLater } from "./compiler-globals.js"; +import { callbacks, IsKeyboardVersion14OrLater, IsKeyboardVersion15OrLater, IsKeyboardVersion17OrLater } from "./compiler-globals.js"; import { JavaScript_Key } from "./javascript-strings.js"; -import { TRequiredKey, CRequiredKeys, CSpecialText10, CSpecialText14, CSpecialText14ZWNJ, CSpecialText14Map } from "./constants.js"; +import { TRequiredKey, CRequiredKeys, CSpecialText10, CSpecialText14, CSpecialText14ZWNJ, CSpecialText14Map, CSpecialText17, CSpecialText17ZWNJ, CSpecialText17Map } from "./constants.js"; import { KeymanWebTouchStandardKeyNames, KMWAdditionalKeyNames, VKeyNames } from "./keymanweb-key-codes.js"; import { KmwCompilerMessages } from "./messages.js"; @@ -147,6 +147,8 @@ function CheckKey( if((CSpecialText10.includes(FText) || CSpecialText14.includes(FText)) && !CSpecialText14ZWNJ.includes(FText) && !IsKeyboardVersion14OrLater() && + !CSpecialText17ZWNJ.includes(FText) && + !IsKeyboardVersion17OrLater() && !([TouchLayout.TouchLayoutKeySp.special, TouchLayout.TouchLayoutKeySp.specialActive].includes(FKeyType))) { callbacks.reportMessage(KmwCompilerMessages.Warn_TouchLayoutSpecialLabelOnNormalKey({ keyId: FId, @@ -199,6 +201,22 @@ function TransformSpecialKeys14(FDebug: boolean, sLayoutFile: string): string { return sLayoutFile; } +function TransformSpecialKeys17(FDebug: boolean, sLayoutFile: string): string { + // Rewrite Special key labels that are only supported in Keyman 17+ + // This code is a little ugly but effective. + if(!IsKeyboardVersion17OrLater()) { + for(let i = 0; i < CSpecialText17Map.length; i++) { + // Assumes the JSON output format will not change + if(FDebug) { + sLayoutFile = sLayoutFile.replaceAll('"text": "'+CSpecialText17Map[i][0]+'"', '"text": this._v>16 ? "'+CSpecialText17Map[i][0]+'" : "'+CSpecialText17Map[i][1]+'"'); + } else { + sLayoutFile = sLayoutFile.replaceAll('"text":"'+CSpecialText17Map[i][0]+'"', '"text":this._v>16?"'+CSpecialText17Map[i][0]+'":"'+CSpecialText17Map[i][1]+'"'); + } + } + } + return sLayoutFile; +} + export function ValidateLayoutFile(fk: KMX.KEYBOARD, FDebug: boolean, sLayoutFile: string, sVKDictionary: string, displayMap: Osk.PuaMap): VLFOutput { // I4060 // I4139 let FDictionary: string[] = sVKDictionary.split(/\s+/); @@ -282,8 +300,10 @@ export function ValidateLayoutFile(fk: KMX.KEYBOARD, FDebug: boolean, sLayoutFil sLayoutFile = TransformSpecialKeys14(FDebug, sLayoutFile); + sLayoutFile = TransformSpecialKeys17(FDebug, sLayoutFile); + return { output: sLayoutFile, result } -} \ No newline at end of file +} From 7b00306954e55fd637ac0458ef6b2f3250708c82 Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Thu, 26 Oct 2023 04:46:57 +0700 Subject: [PATCH 03/18] fix(developer): Add check for CSpecialText17 --- developer/src/kmc-kmn/src/kmw-compiler/validate-layout-file.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/developer/src/kmc-kmn/src/kmw-compiler/validate-layout-file.ts b/developer/src/kmc-kmn/src/kmw-compiler/validate-layout-file.ts index 7a1ee1842c4..4d12425df09 100644 --- a/developer/src/kmc-kmn/src/kmw-compiler/validate-layout-file.ts +++ b/developer/src/kmc-kmn/src/kmw-compiler/validate-layout-file.ts @@ -144,7 +144,7 @@ function CheckKey( // Keyman versions before 14 do not support '*special*' labels on non-special keys. // ZWNJ use, however, is safe because it will be transformed in function // TransformSpecialKeys14 to '<|>', which does not require the custom OSK font. - if((CSpecialText10.includes(FText) || CSpecialText14.includes(FText)) && + if((CSpecialText10.includes(FText) || CSpecialText14.includes(FText) || CSpecialText17.includes(FText)) && !CSpecialText14ZWNJ.includes(FText) && !IsKeyboardVersion14OrLater() && !CSpecialText17ZWNJ.includes(FText) && From 4085612ad9b4a724aca31abf218bf60f40cf6a0e Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Mon, 30 Oct 2023 09:26:22 +0700 Subject: [PATCH 04/18] fix(developer): Revise check on special characters --- .../src/kmc-kmn/src/kmw-compiler/constants.ts | 15 +++++++++++++-- .../src/kmw-compiler/validate-layout-file.ts | 12 +++++------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/developer/src/kmc-kmn/src/kmw-compiler/constants.ts b/developer/src/kmc-kmn/src/kmw-compiler/constants.ts index a8d88538843..90f71cefeac 100644 --- a/developer/src/kmc-kmn/src/kmw-compiler/constants.ts +++ b/developer/src/kmc-kmn/src/kmw-compiler/constants.ts @@ -8,9 +8,9 @@ export const // See also builder.js: specialCharacters; web/source/osk/oskKey.ts: specialCharacters export const CSpecialText10: string = '*Shift*\0*Enter*\0*Tab*\0*BkSp*\0*Menu*\0*Hide*\0*Alt*\0*Ctrl*\0*Caps*\0' + - '*ABC*\0*abc*\0*123*\0*Symbol*\0*Currency*\0*Shifted*\0*AltGr*\0*TabLeft*', + '*ABC*\0*abc*\0*123*\0*Symbol*\0*Currency*\0*Shifted*\0*AltGr*\0*TabLeft*\0', // these names were added in Keyman 14 - CSpecialText14: string = '*LTREnter*\0*LTRBkSp*\0*RTLEnter*\0*RTLBkSp*\0*ShiftLock*\0*ShiftedLock*\0*ZWNJ*\0*ZWNJiOS*\0*ZWNJAndroid*', + CSpecialText14: string = '*LTREnter*\0*LTRBkSp*\0*RTLEnter*\0*RTLBkSp*\0*ShiftLock*\0*ShiftedLock*\0*ZWNJ*\0*ZWNJiOS*\0*ZWNJAndroid*\0', CSpecialText14ZWNJ: string = '*ZWNJ*\0*ZWNJiOS*\0*ZWNJAndroid*', CSpecialText14Map: string[][] = [ ['*LTREnter*', '*Enter*'], @@ -31,6 +31,17 @@ export const ['*ZWNJGeneric*', '<|>'] ]; + // Map for checking minimum versions and Special Text + export const CSpecialText = new Map([ + [10, CSpecialText10], + [11, CSpecialText10], + [12, CSpecialText10], + [13, CSpecialText10], + [14, CSpecialText14 + CSpecialText10], + [15, CSpecialText14 + CSpecialText10], + [16, CSpecialText14 + CSpecialText10], + [17, CSpecialText17 + CSpecialText14 + CSpecialText10] + ]); // These correspond to TSS_ values in kmx.ts export const diff --git a/developer/src/kmc-kmn/src/kmw-compiler/validate-layout-file.ts b/developer/src/kmc-kmn/src/kmw-compiler/validate-layout-file.ts index 4d12425df09..cc86d4bca32 100644 --- a/developer/src/kmc-kmn/src/kmw-compiler/validate-layout-file.ts +++ b/developer/src/kmc-kmn/src/kmw-compiler/validate-layout-file.ts @@ -1,7 +1,7 @@ import { KMX, Osk, TouchLayout, TouchLayoutFileReader, TouchLayoutFileWriter } from "@keymanapp/common-types"; -import { callbacks, IsKeyboardVersion14OrLater, IsKeyboardVersion15OrLater, IsKeyboardVersion17OrLater } from "./compiler-globals.js"; +import { callbacks, fk, IsKeyboardVersion14OrLater, IsKeyboardVersion15OrLater, IsKeyboardVersion17OrLater } from "./compiler-globals.js"; import { JavaScript_Key } from "./javascript-strings.js"; -import { TRequiredKey, CRequiredKeys, CSpecialText10, CSpecialText14, CSpecialText14ZWNJ, CSpecialText14Map, CSpecialText17, CSpecialText17ZWNJ, CSpecialText17Map } from "./constants.js"; +import { TRequiredKey, CRequiredKeys, CSpecialText, CSpecialText14ZWNJ, CSpecialText14Map, CSpecialText17ZWNJ, CSpecialText17Map } from "./constants.js"; import { KeymanWebTouchStandardKeyNames, KMWAdditionalKeyNames, VKeyNames } from "./keymanweb-key-codes.js"; import { KmwCompilerMessages } from "./messages.js"; @@ -144,11 +144,9 @@ function CheckKey( // Keyman versions before 14 do not support '*special*' labels on non-special keys. // ZWNJ use, however, is safe because it will be transformed in function // TransformSpecialKeys14 to '<|>', which does not require the custom OSK font. - if((CSpecialText10.includes(FText) || CSpecialText14.includes(FText) || CSpecialText17.includes(FText)) && - !CSpecialText14ZWNJ.includes(FText) && - !IsKeyboardVersion14OrLater() && - !CSpecialText17ZWNJ.includes(FText) && - !IsKeyboardVersion17OrLater() && + const mapVersion = (fk.fileVersion > 17 ? 17 : fk.fileVersion < 10 ? 10 : fk.fileVersion); + const specialText = CSpecialText.get(mapVersion); + if(specialText.includes(FText) && !([TouchLayout.TouchLayoutKeySp.special, TouchLayout.TouchLayoutKeySp.specialActive].includes(FKeyType))) { callbacks.reportMessage(KmwCompilerMessages.Warn_TouchLayoutSpecialLabelOnNormalKey({ keyId: FId, From 2064ac4556a2ffdb558a7e753163d0f5e90cfe91 Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Mon, 30 Oct 2023 09:29:30 +0700 Subject: [PATCH 05/18] chore(developer): Cleanup unused ZWNJ --- developer/src/kmc-kmn/src/kmw-compiler/validate-layout-file.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/developer/src/kmc-kmn/src/kmw-compiler/validate-layout-file.ts b/developer/src/kmc-kmn/src/kmw-compiler/validate-layout-file.ts index cc86d4bca32..fb0e21d83a0 100644 --- a/developer/src/kmc-kmn/src/kmw-compiler/validate-layout-file.ts +++ b/developer/src/kmc-kmn/src/kmw-compiler/validate-layout-file.ts @@ -1,7 +1,7 @@ import { KMX, Osk, TouchLayout, TouchLayoutFileReader, TouchLayoutFileWriter } from "@keymanapp/common-types"; import { callbacks, fk, IsKeyboardVersion14OrLater, IsKeyboardVersion15OrLater, IsKeyboardVersion17OrLater } from "./compiler-globals.js"; import { JavaScript_Key } from "./javascript-strings.js"; -import { TRequiredKey, CRequiredKeys, CSpecialText, CSpecialText14ZWNJ, CSpecialText14Map, CSpecialText17ZWNJ, CSpecialText17Map } from "./constants.js"; +import { TRequiredKey, CRequiredKeys, CSpecialText, CSpecialText14Map, CSpecialText17Map } from "./constants.js"; import { KeymanWebTouchStandardKeyNames, KMWAdditionalKeyNames, VKeyNames } from "./keymanweb-key-codes.js"; import { KmwCompilerMessages } from "./messages.js"; From 06cf276806e6bd1bce8d27a6a4206af9119a4149 Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Thu, 2 Nov 2023 13:22:49 +0700 Subject: [PATCH 06/18] Apply suggestions from code review Co-authored-by: Marc Durdin --- .../src/kmc-kmn/src/kmw-compiler/constants.ts | 18 ++++++++++-------- .../src/kmw-compiler/validate-layout-file.ts | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/developer/src/kmc-kmn/src/kmw-compiler/constants.ts b/developer/src/kmc-kmn/src/kmw-compiler/constants.ts index 90f71cefeac..09c42898d57 100644 --- a/developer/src/kmc-kmn/src/kmw-compiler/constants.ts +++ b/developer/src/kmc-kmn/src/kmw-compiler/constants.ts @@ -33,15 +33,17 @@ export const // Map for checking minimum versions and Special Text export const CSpecialText = new Map([ - [10, CSpecialText10], - [11, CSpecialText10], - [12, CSpecialText10], - [13, CSpecialText10], - [14, CSpecialText14 + CSpecialText10], - [15, CSpecialText14 + CSpecialText10], - [16, CSpecialText14 + CSpecialText10], - [17, CSpecialText17 + CSpecialText14 + CSpecialText10] + [KMX.KMXFile.VERSION_100, CSpecialText10], + [KMX.KMXFile.VERSION_110, CSpecialText10], + [KMX.KMXFile.VERSION_120, CSpecialText10], + [KMX.KMXFile.VERSION_130, CSpecialText10], + [KMX.KMXFile.VERSION_140, CSpecialText14 + CSpecialText10], + [KMX.KMXFile.VERSION_150, CSpecialText14 + CSpecialText10], + [KMX.KMXFile.VERSION_160, CSpecialText14 + CSpecialText10], + [KMX.KMXFile.VERSION_170, CSpecialText17 + CSpecialText14 + CSpecialText10] ]); + export const CSpecialTextMinVer = KMX.KMXFile.VERSION_100; + export const CSpecialTextMaxVer = KMX.KMXFile.VERSION_170; // These correspond to TSS_ values in kmx.ts export const diff --git a/developer/src/kmc-kmn/src/kmw-compiler/validate-layout-file.ts b/developer/src/kmc-kmn/src/kmw-compiler/validate-layout-file.ts index fb0e21d83a0..f9da003fa86 100644 --- a/developer/src/kmc-kmn/src/kmw-compiler/validate-layout-file.ts +++ b/developer/src/kmc-kmn/src/kmw-compiler/validate-layout-file.ts @@ -144,7 +144,7 @@ function CheckKey( // Keyman versions before 14 do not support '*special*' labels on non-special keys. // ZWNJ use, however, is safe because it will be transformed in function // TransformSpecialKeys14 to '<|>', which does not require the custom OSK font. - const mapVersion = (fk.fileVersion > 17 ? 17 : fk.fileVersion < 10 ? 10 : fk.fileVersion); + const mapVersion = (fk.fileVersion > CSpecialTextMaxVer ? CSpecialTextMaxVer : fk.fileVersion < CSpecialTextMinVer ? CSpecialTextMinVer : fk.fileVersion); const specialText = CSpecialText.get(mapVersion); if(specialText.includes(FText) && !([TouchLayout.TouchLayoutKeySp.special, TouchLayout.TouchLayoutKeySp.specialActive].includes(FKeyType))) { From ecae59062b5fe95ca91a1443f1eb6319d9042854 Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Thu, 2 Nov 2023 15:50:50 +0700 Subject: [PATCH 07/18] fix(developer): Update keymanweb-osk.ttf font --- .../tike/xml/layoutbuilder/keymanweb-osk.ttf | Bin 40076 -> 35164 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/developer/src/tike/xml/layoutbuilder/keymanweb-osk.ttf b/developer/src/tike/xml/layoutbuilder/keymanweb-osk.ttf index d33aedc35efe6928b5f134fae9fcb8296fb6725d..e0651b14d4f770d2a9b15e8850203c05112a23d7 100644 GIT binary patch delta 6545 zcmaJl3wV=NmgnC8m9(X8nx>&In!Zz7`bhfX+46ovfzk)BCT-F-B~5;kltN_)ium3E z4JeAZI-j}>i;Bj@WrlS-v$Nmeh={X}pzE#?AB(QbR7U}6^LNkxCv8EUNqg@(_uO;O zJ?GqW&VT>^q0{ukN2nhN0K~u^V8F0?U75-ETdjeZ^HxiPs#(stPr`Ynkdwn~eW@6Xk+WWAbaJoCJ z@5KJv1i;#G{)1lY4!;QZlOCK@A;I9X_S!ezzpoQu%UOW@LDB8?eSRo!DZt$*fPF_% zmIe6a$mz3f3A4TfMqUQ+ap9pF1(s&+8yS`iiIu_`9P>bBD*n(&;f!PeNbDRL9vM!o zR3zcV0(n;X^(Z7KSpX@Jhu)C=GVzngtT34z01mA;vv1+l6A?(?3d|$<{y~7yZz7ur zXGjR=6$$jJpqPg0e*|b4C_2##aDiSJ9ilKgg!Wuf0Xc?n2;oV33?4(hE6H)tGX^+L zufT^g9|?^Paqof!U{ntfzJuP47JdoI01__sOXwjP89fUyGE4`doUMm)`XtO`&9I33 z2Ik3n&^>Sr+eK_gu{C2Whe0qZO<5bh1KF-2UFHQmOp|&um|}kiCjK*QLy@NX8ceGH z!?~Y>DJBu;{as*+6AKvCfSho0>b|SQ+ylFox-^$6tEQA$H;Rh zn1q+G^-n|7j;$4$k`YQ^q9Y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L5`L=9brU`SrEsQfScHdR}#PVQqeHU7>Y(RimZF z<>yw{NeW8lmekkT|iU)tL$LwxrMp4jm3q9 Date: Thu, 2 Nov 2023 16:32:41 +0700 Subject: [PATCH 08/18] fix(developer): import KMX --- developer/src/kmc-kmn/src/kmw-compiler/constants.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/developer/src/kmc-kmn/src/kmw-compiler/constants.ts b/developer/src/kmc-kmn/src/kmw-compiler/constants.ts index 09c42898d57..8c7d5860690 100644 --- a/developer/src/kmc-kmn/src/kmw-compiler/constants.ts +++ b/developer/src/kmc-kmn/src/kmw-compiler/constants.ts @@ -1,3 +1,5 @@ +import { KMX } from "@keymanapp/common-types"; + export enum TRequiredKey { K_LOPT='K_LOPT', K_BKSP='K_BKSP', K_ENTER='K_ENTER' }; // I4447 From 25c54d363c2795c610e9f999cc4af7fe3b8735fa Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Thu, 2 Nov 2023 17:37:43 +0700 Subject: [PATCH 09/18] fix(common): Add constants --- common/web/types/src/kmx/kmx.ts | 5 ++++- .../src/kmc-kmn/src/kmw-compiler/validate-layout-file.ts | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/common/web/types/src/kmx/kmx.ts b/common/web/types/src/kmx/kmx.ts index 6102a69cf55..873b575205a 100644 --- a/common/web/types/src/kmx/kmx.ts +++ b/common/web/types/src/kmx/kmx.ts @@ -140,6 +140,9 @@ export class KMXFile { public static readonly VERSION_80 = 0x00000800; public static readonly VERSION_90 = 0x00000900; public static readonly VERSION_100 = 0x00000A00; + public static readonly VERSION_110 = 0x00000B00; + public static readonly VERSION_120 = 0x00000C00; + public static readonly VERSION_130 = 0x00000D00; public static readonly VERSION_140 = 0x00000E00; public static readonly VERSION_150 = 0x00000F00; @@ -457,4 +460,4 @@ export class KMXFile { throw "COMP_KEYBOARD size is "+this.COMP_KEYBOARD.size()+" but should be "+KMXFile.COMP_KEYBOARD_SIZE+" bytes"; } } -} \ No newline at end of file +} diff --git a/developer/src/kmc-kmn/src/kmw-compiler/validate-layout-file.ts b/developer/src/kmc-kmn/src/kmw-compiler/validate-layout-file.ts index f9da003fa86..7838d836d92 100644 --- a/developer/src/kmc-kmn/src/kmw-compiler/validate-layout-file.ts +++ b/developer/src/kmc-kmn/src/kmw-compiler/validate-layout-file.ts @@ -1,7 +1,7 @@ import { KMX, Osk, TouchLayout, TouchLayoutFileReader, TouchLayoutFileWriter } from "@keymanapp/common-types"; import { callbacks, fk, IsKeyboardVersion14OrLater, IsKeyboardVersion15OrLater, IsKeyboardVersion17OrLater } from "./compiler-globals.js"; import { JavaScript_Key } from "./javascript-strings.js"; -import { TRequiredKey, CRequiredKeys, CSpecialText, CSpecialText14Map, CSpecialText17Map } from "./constants.js"; +import { TRequiredKey, CRequiredKeys, CSpecialText, CSpecialText14Map, CSpecialText17Map, CSpecialTextMinVer, CSpecialTextMaxVer } from "./constants.js"; import { KeymanWebTouchStandardKeyNames, KMWAdditionalKeyNames, VKeyNames } from "./keymanweb-key-codes.js"; import { KmwCompilerMessages } from "./messages.js"; From 024b20a8393bb285491c181064e892fb04b7ceb3 Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Thu, 2 Nov 2023 21:05:51 +0700 Subject: [PATCH 10/18] fix(developer): Define special touch layout key --- .../test/auto/kmcomp/test_touchlayout_14_2.keyman-touch-layout | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/developer/src/test/auto/kmcomp/test_touchlayout_14_2.keyman-touch-layout b/developer/src/test/auto/kmcomp/test_touchlayout_14_2.keyman-touch-layout index 7c36c893249..e43108aa1e5 100644 --- a/developer/src/test/auto/kmcomp/test_touchlayout_14_2.keyman-touch-layout +++ b/developer/src/test/auto/kmcomp/test_touchlayout_14_2.keyman-touch-layout @@ -115,6 +115,7 @@ { "id": "K_X", "text": "*Enter*" + "sp": "1", }, { "id": "K_C", @@ -665,4 +666,4 @@ ], "displayUnderlying": false } -} \ No newline at end of file +} From bfac2795d1acccdc1f6de3e0d2e3334202b229ed Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Fri, 3 Nov 2023 04:57:32 +0700 Subject: [PATCH 11/18] fix(developer): Fix JSON --- .../auto/kmcomp/test_touchlayout_14_2.keyman-touch-layout | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/developer/src/test/auto/kmcomp/test_touchlayout_14_2.keyman-touch-layout b/developer/src/test/auto/kmcomp/test_touchlayout_14_2.keyman-touch-layout index e43108aa1e5..9d8c34ef083 100644 --- a/developer/src/test/auto/kmcomp/test_touchlayout_14_2.keyman-touch-layout +++ b/developer/src/test/auto/kmcomp/test_touchlayout_14_2.keyman-touch-layout @@ -114,8 +114,8 @@ }, { "id": "K_X", - "text": "*Enter*" - "sp": "1", + "text": "*Enter*", + "sp": "1" }, { "id": "K_C", From 16cd8a6e17d4844e1d8ec4c6068bf1f0fd52c6f3 Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Fri, 3 Nov 2023 06:35:47 +0700 Subject: [PATCH 12/18] fix(developer): Define special touch layout key for other tests --- .../auto/kmcomp/test_194_filename_case.keyman-touch-layout | 5 +++-- .../auto/kmcomp/test_touchlayout_14_1.keyman-touch-layout | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/developer/src/test/auto/kmcomp/test_194_filename_case.keyman-touch-layout b/developer/src/test/auto/kmcomp/test_194_filename_case.keyman-touch-layout index 7c36c893249..9d8c34ef083 100644 --- a/developer/src/test/auto/kmcomp/test_194_filename_case.keyman-touch-layout +++ b/developer/src/test/auto/kmcomp/test_194_filename_case.keyman-touch-layout @@ -114,7 +114,8 @@ }, { "id": "K_X", - "text": "*Enter*" + "text": "*Enter*", + "sp": "1" }, { "id": "K_C", @@ -665,4 +666,4 @@ ], "displayUnderlying": false } -} \ No newline at end of file +} diff --git a/developer/src/test/auto/kmcomp/test_touchlayout_14_1.keyman-touch-layout b/developer/src/test/auto/kmcomp/test_touchlayout_14_1.keyman-touch-layout index 7c36c893249..9d8c34ef083 100644 --- a/developer/src/test/auto/kmcomp/test_touchlayout_14_1.keyman-touch-layout +++ b/developer/src/test/auto/kmcomp/test_touchlayout_14_1.keyman-touch-layout @@ -114,7 +114,8 @@ }, { "id": "K_X", - "text": "*Enter*" + "text": "*Enter*", + "sp": "1" }, { "id": "K_C", @@ -665,4 +666,4 @@ ], "displayUnderlying": false } -} \ No newline at end of file +} From a02dde9f1ccf664500fe0899f814c20151e2e68e Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Fri, 3 Nov 2023 07:50:44 +0700 Subject: [PATCH 13/18] fix(developer): Revert 14_1 --- .../test/auto/kmcomp/test_touchlayout_14_1.keyman-touch-layout | 1 - .../test/auto/kmcomp/test_touchlayout_14_3.keyman-touch-layout | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/developer/src/test/auto/kmcomp/test_touchlayout_14_1.keyman-touch-layout b/developer/src/test/auto/kmcomp/test_touchlayout_14_1.keyman-touch-layout index 9d8c34ef083..0fe6efcf550 100644 --- a/developer/src/test/auto/kmcomp/test_touchlayout_14_1.keyman-touch-layout +++ b/developer/src/test/auto/kmcomp/test_touchlayout_14_1.keyman-touch-layout @@ -115,7 +115,6 @@ { "id": "K_X", "text": "*Enter*", - "sp": "1" }, { "id": "K_C", diff --git a/developer/src/test/auto/kmcomp/test_touchlayout_14_3.keyman-touch-layout b/developer/src/test/auto/kmcomp/test_touchlayout_14_3.keyman-touch-layout index 6705864636a..577ff750258 100644 --- a/developer/src/test/auto/kmcomp/test_touchlayout_14_3.keyman-touch-layout +++ b/developer/src/test/auto/kmcomp/test_touchlayout_14_3.keyman-touch-layout @@ -665,4 +665,4 @@ ], "displayUnderlying": false } -} \ No newline at end of file +} From 56a86a8f87521f27d9e292eb0e535467a42d7533 Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Mon, 6 Nov 2023 13:42:36 +0700 Subject: [PATCH 14/18] Apply suggestions from code review Co-authored-by: Marc Durdin --- developer/src/kmc-kmn/src/kmw-compiler/constants.ts | 6 +++--- .../src/kmc-kmn/src/kmw-compiler/validate-layout-file.ts | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/developer/src/kmc-kmn/src/kmw-compiler/constants.ts b/developer/src/kmc-kmn/src/kmw-compiler/constants.ts index 8c7d5860690..1c41df145b8 100644 --- a/developer/src/kmc-kmn/src/kmw-compiler/constants.ts +++ b/developer/src/kmc-kmn/src/kmw-compiler/constants.ts @@ -36,9 +36,9 @@ export const // Map for checking minimum versions and Special Text export const CSpecialText = new Map([ [KMX.KMXFile.VERSION_100, CSpecialText10], - [KMX.KMXFile.VERSION_110, CSpecialText10], - [KMX.KMXFile.VERSION_120, CSpecialText10], - [KMX.KMXFile.VERSION_130, CSpecialText10], + // [KMX.KMXFile.VERSION_110, CSpecialText10], - this file version does not exist + // [KMX.KMXFile.VERSION_120, CSpecialText10], - this file version does not exist + // [KMX.KMXFile.VERSION_130, CSpecialText10], - this file version does not exist [KMX.KMXFile.VERSION_140, CSpecialText14 + CSpecialText10], [KMX.KMXFile.VERSION_150, CSpecialText14 + CSpecialText10], [KMX.KMXFile.VERSION_160, CSpecialText14 + CSpecialText10], diff --git a/developer/src/kmc-kmn/src/kmw-compiler/validate-layout-file.ts b/developer/src/kmc-kmn/src/kmw-compiler/validate-layout-file.ts index 7838d836d92..9a12e7d05ce 100644 --- a/developer/src/kmc-kmn/src/kmw-compiler/validate-layout-file.ts +++ b/developer/src/kmc-kmn/src/kmw-compiler/validate-layout-file.ts @@ -147,6 +147,7 @@ function CheckKey( const mapVersion = (fk.fileVersion > CSpecialTextMaxVer ? CSpecialTextMaxVer : fk.fileVersion < CSpecialTextMinVer ? CSpecialTextMinVer : fk.fileVersion); const specialText = CSpecialText.get(mapVersion); if(specialText.includes(FText) && + !IsKeyboardVersion14OrLater() && !([TouchLayout.TouchLayoutKeySp.special, TouchLayout.TouchLayoutKeySp.specialActive].includes(FKeyType))) { callbacks.reportMessage(KmwCompilerMessages.Warn_TouchLayoutSpecialLabelOnNormalKey({ keyId: FId, From 132c8c79809f65edc5e842fcc4b0712e72c40322 Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Mon, 6 Nov 2023 13:48:31 +0700 Subject: [PATCH 15/18] fix(developer): Revert test changes --- .../test/auto/kmcomp/test_touchlayout_14_1.keyman-touch-layout | 2 +- .../test/auto/kmcomp/test_touchlayout_14_2.keyman-touch-layout | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/developer/src/test/auto/kmcomp/test_touchlayout_14_1.keyman-touch-layout b/developer/src/test/auto/kmcomp/test_touchlayout_14_1.keyman-touch-layout index 0fe6efcf550..ab44666c3bc 100644 --- a/developer/src/test/auto/kmcomp/test_touchlayout_14_1.keyman-touch-layout +++ b/developer/src/test/auto/kmcomp/test_touchlayout_14_1.keyman-touch-layout @@ -114,7 +114,7 @@ }, { "id": "K_X", - "text": "*Enter*", + "text": "*Enter*" }, { "id": "K_C", diff --git a/developer/src/test/auto/kmcomp/test_touchlayout_14_2.keyman-touch-layout b/developer/src/test/auto/kmcomp/test_touchlayout_14_2.keyman-touch-layout index 9d8c34ef083..ab44666c3bc 100644 --- a/developer/src/test/auto/kmcomp/test_touchlayout_14_2.keyman-touch-layout +++ b/developer/src/test/auto/kmcomp/test_touchlayout_14_2.keyman-touch-layout @@ -114,8 +114,7 @@ }, { "id": "K_X", - "text": "*Enter*", - "sp": "1" + "text": "*Enter*" }, { "id": "K_C", From 7ff8d7acd97b9e5e37a70ca2b899606a37150b8c Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Mon, 6 Nov 2023 13:52:20 +0700 Subject: [PATCH 16/18] chore(common): revert VERSIONs --- common/web/types/src/kmx/kmx.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/common/web/types/src/kmx/kmx.ts b/common/web/types/src/kmx/kmx.ts index 873b575205a..74995221c82 100644 --- a/common/web/types/src/kmx/kmx.ts +++ b/common/web/types/src/kmx/kmx.ts @@ -140,9 +140,6 @@ export class KMXFile { public static readonly VERSION_80 = 0x00000800; public static readonly VERSION_90 = 0x00000900; public static readonly VERSION_100 = 0x00000A00; - public static readonly VERSION_110 = 0x00000B00; - public static readonly VERSION_120 = 0x00000C00; - public static readonly VERSION_130 = 0x00000D00; public static readonly VERSION_140 = 0x00000E00; public static readonly VERSION_150 = 0x00000F00; From 699e1f350b963dd432c4e1717efdcaf8c53a1084 Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Mon, 6 Nov 2023 15:25:59 +0700 Subject: [PATCH 17/18] chore(common): Revert other files --- common/web/types/src/kmx/kmx.ts | 2 +- .../auto/kmcomp/test_194_filename_case.keyman-touch-layout | 5 ++--- .../auto/kmcomp/test_touchlayout_14_1.keyman-touch-layout | 2 +- .../auto/kmcomp/test_touchlayout_14_2.keyman-touch-layout | 2 +- .../auto/kmcomp/test_touchlayout_14_3.keyman-touch-layout | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/common/web/types/src/kmx/kmx.ts b/common/web/types/src/kmx/kmx.ts index 74995221c82..6102a69cf55 100644 --- a/common/web/types/src/kmx/kmx.ts +++ b/common/web/types/src/kmx/kmx.ts @@ -457,4 +457,4 @@ export class KMXFile { throw "COMP_KEYBOARD size is "+this.COMP_KEYBOARD.size()+" but should be "+KMXFile.COMP_KEYBOARD_SIZE+" bytes"; } } -} +} \ No newline at end of file diff --git a/developer/src/test/auto/kmcomp/test_194_filename_case.keyman-touch-layout b/developer/src/test/auto/kmcomp/test_194_filename_case.keyman-touch-layout index 9d8c34ef083..7c36c893249 100644 --- a/developer/src/test/auto/kmcomp/test_194_filename_case.keyman-touch-layout +++ b/developer/src/test/auto/kmcomp/test_194_filename_case.keyman-touch-layout @@ -114,8 +114,7 @@ }, { "id": "K_X", - "text": "*Enter*", - "sp": "1" + "text": "*Enter*" }, { "id": "K_C", @@ -666,4 +665,4 @@ ], "displayUnderlying": false } -} +} \ No newline at end of file diff --git a/developer/src/test/auto/kmcomp/test_touchlayout_14_1.keyman-touch-layout b/developer/src/test/auto/kmcomp/test_touchlayout_14_1.keyman-touch-layout index ab44666c3bc..7c36c893249 100644 --- a/developer/src/test/auto/kmcomp/test_touchlayout_14_1.keyman-touch-layout +++ b/developer/src/test/auto/kmcomp/test_touchlayout_14_1.keyman-touch-layout @@ -665,4 +665,4 @@ ], "displayUnderlying": false } -} +} \ No newline at end of file diff --git a/developer/src/test/auto/kmcomp/test_touchlayout_14_2.keyman-touch-layout b/developer/src/test/auto/kmcomp/test_touchlayout_14_2.keyman-touch-layout index ab44666c3bc..7c36c893249 100644 --- a/developer/src/test/auto/kmcomp/test_touchlayout_14_2.keyman-touch-layout +++ b/developer/src/test/auto/kmcomp/test_touchlayout_14_2.keyman-touch-layout @@ -665,4 +665,4 @@ ], "displayUnderlying": false } -} +} \ No newline at end of file diff --git a/developer/src/test/auto/kmcomp/test_touchlayout_14_3.keyman-touch-layout b/developer/src/test/auto/kmcomp/test_touchlayout_14_3.keyman-touch-layout index 577ff750258..6705864636a 100644 --- a/developer/src/test/auto/kmcomp/test_touchlayout_14_3.keyman-touch-layout +++ b/developer/src/test/auto/kmcomp/test_touchlayout_14_3.keyman-touch-layout @@ -665,4 +665,4 @@ ], "displayUnderlying": false } -} +} \ No newline at end of file From 5902c764c74c5179333a1605513c6b870a32e604 Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Mon, 6 Nov 2023 15:26:32 +0700 Subject: [PATCH 18/18] Apply suggestions from code review Co-authored-by: Marc Durdin --- developer/src/kmc-kmn/src/kmw-compiler/validate-layout-file.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/developer/src/kmc-kmn/src/kmw-compiler/validate-layout-file.ts b/developer/src/kmc-kmn/src/kmw-compiler/validate-layout-file.ts index 9a12e7d05ce..e745269ee3a 100644 --- a/developer/src/kmc-kmn/src/kmw-compiler/validate-layout-file.ts +++ b/developer/src/kmc-kmn/src/kmw-compiler/validate-layout-file.ts @@ -144,7 +144,7 @@ function CheckKey( // Keyman versions before 14 do not support '*special*' labels on non-special keys. // ZWNJ use, however, is safe because it will be transformed in function // TransformSpecialKeys14 to '<|>', which does not require the custom OSK font. - const mapVersion = (fk.fileVersion > CSpecialTextMaxVer ? CSpecialTextMaxVer : fk.fileVersion < CSpecialTextMinVer ? CSpecialTextMinVer : fk.fileVersion); + const mapVersion = Math.max(Math.min(fk.fileVersion, CSpecialTextMaxVer), CSpecialTextMinVer); const specialText = CSpecialText.get(mapVersion); if(specialText.includes(FText) && !IsKeyboardVersion14OrLater() &&