From ecc9edeb66f0b70f26fa3ce25676b5dc7bdceafd Mon Sep 17 00:00:00 2001 From: "Joshua A. Horton" Date: Thu, 20 Oct 2022 08:54:19 +0700 Subject: [PATCH] change(web): layout row id number coercion --- common/web/keyboard-processor/src/keyboards/activeLayout.ts | 5 ++++- .../web/keyboard-processor/src/keyboards/defaultLayouts.ts | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/common/web/keyboard-processor/src/keyboards/activeLayout.ts b/common/web/keyboard-processor/src/keyboards/activeLayout.ts index 936b4410b0..d306d683c6 100644 --- a/common/web/keyboard-processor/src/keyboards/activeLayout.ts +++ b/common/web/keyboard-processor/src/keyboards/activeLayout.ts @@ -280,7 +280,7 @@ namespace com.keyman.keyboards { // Identify key labels (e.g. *Shift*) that require the special OSK font static readonly SPECIAL_LABEL=/\*\w+\*/; - id: string; + id: number; key: ActiveKey[]; /** @@ -381,6 +381,9 @@ namespace com.keyman.keyboards { let aRow = row as ActiveRow; aRow.proportionalY = proportionalY; + if(typeof row.id == 'string') { + row.id = Number.parseInt(row.id, 10); + } } populateKeyMap(map: {[keyId: string]: ActiveKey}) { diff --git a/common/web/keyboard-processor/src/keyboards/defaultLayouts.ts b/common/web/keyboard-processor/src/keyboards/defaultLayouts.ts index e0e4d3468c..ca5a5f2e1d 100644 --- a/common/web/keyboard-processor/src/keyboards/defaultLayouts.ts +++ b/common/web/keyboard-processor/src/keyboards/defaultLayouts.ts @@ -26,7 +26,7 @@ namespace com.keyman.keyboards { } export type LayoutRow = { - "id": string, // represents a number, though... + "id": string | number, "key": LayoutKey[] };