Skip to content

feat(developer): add kmap support to KMX+ kvk and keyman-touch-layout 🔱#15821

Merged
mcdurdin merged 3 commits intoepic/embed-osk-in-kmxfrom
feat/developer/embed-osk/kmap
Apr 16, 2026
Merged

feat(developer): add kmap support to KMX+ kvk and keyman-touch-layout 🔱#15821
mcdurdin merged 3 commits intoepic/embed-osk-in-kmxfrom
feat/developer/embed-osk/kmap

Conversation

@mcdurdin
Copy link
Copy Markdown
Member

@mcdurdin mcdurdin commented Apr 7, 2026

Add mappings for key to vkey + mod for .kvk and .keyman-touch-layout, and clarify the key identifiers for .keyman-touch-layout within KMX+ format.

Update unit test fixture khmer_angkor.keyman_touch_layout to remove dependency on .kmn (T_xxxx_yyyy -> U_xxxx_yyyy), as the relevant VKDictionary will not be present, because the corresponding .kmn is not compiled for the unit tests where the fixture is used.

Also refactor the getModifierState and getStateFromLayer functions into a cleaner modifierStringToState function, and move from web into common.

Marks existing functions as deprecated but does not update usage at this time.

Test-bot: skip

@keymanapp-test-bot
Copy link
Copy Markdown

keymanapp-test-bot bot commented Apr 7, 2026

User Test Results

Test specification and instructions

User tests are not required

@keymanapp-test-bot keymanapp-test-bot bot changed the title feat(developer): add kmap support to KMX+ kvk and keyman-touch-layout feat(developer): add kmap support to KMX+ kvk and keyman-touch-layout 🔱 Apr 7, 2026
@keymanapp-test-bot keymanapp-test-bot bot added this to the A19S26 milestone Apr 7, 2026
@mcdurdin mcdurdin requested a review from ermshiperete April 7, 2026 14:15
Comment thread developer/src/kmc-kmn/src/compiler/embed-osk/embed-osk-touch-layout.ts Outdated
return layerBags;
}

private addKmap(keys: KMXPlus.Keys, newKey: KMXPlus.KeysKeys, vkey: number, mod: number) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better name might be addToKmap (or even addToKeymap or addKeyToKmap)

Comment thread developer/src/kmc-kmn/src/compiler/embed-osk/embed-osk-touch-layout.ts Outdated
Comment thread developer/src/kmc-kmn/src/compiler/embed-osk/embed-osk-touch-layout.ts Outdated
Comment thread developer/src/kmc-kmn/src/compiler/embed-osk/embed-osk-touch-layout.ts Outdated
Comment thread developer/src/kmc-kmn/src/compiler/embed-osk/embed-osk-touch-layout.ts Outdated
Comment thread developer/src/kmc-kmn/src/compiler/kmn-compiler-messages.ts Outdated
Comment thread docs/file-formats/kmx-plus-file-format.md Outdated
Comment thread developer/src/kmc-kmn/src/compiler/embed-osk/embed-osk-kvk.ts Outdated

assert.isArray(keys.kmap);
assert.isEmpty(keys.kmap);
assert.lengthOf(keys.kmap, keys.keys.length);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From devin.ai:

KVK kmap test only checks length, not modifier values

The KVK embedding test at embed-osk-kvk.tests.ts:118 was updated from assert.isEmpty(keys.kmap) to assert.lengthOf(keys.kmap, keys.keys.length) but does not validate the actual content of kmap entries (vkey, mod values). This means the bug where key.shift (VisualKeyboardShiftState) is passed instead of the LDML modifier to addKmap is not caught by the test suite. Adding content assertions (similar to what the touch layout test does at embed-osk-touch-layout.tests.ts:176-181) would have caught this issue.

@keyman-server keyman-server modified the milestones: A19S26, A19S27 Apr 14, 2026
@mcdurdin mcdurdin force-pushed the chore/common/embed-osk/15752-cleanup branch from 4be89fe to c985808 Compare April 16, 2026 07:15
Refactor the `getModifierState` and `getStateFromLayer` functions into a
cleaner `modifierStringToState` function, and move from web into common.

Marks existing functions as deprecated but does not update usage at this
time.
Add mappings for key to vkey + mod for .kvk and .keyman-touch-layout,
and clarify the key identifiers for .keyman-touch-layout within KMX+
format.

Update unit test fixture khmer_angkor.keyman_touch_layout to remove
dependency on .kmn (T_xxxx_yyyy -> U_xxxx_yyyy), as the relevant
VKDictionary will not be present, because the corresponding .kmn is not
compiled for the unit tests where the fixture is used.

Test-bot: skip
@mcdurdin mcdurdin force-pushed the feat/developer/embed-osk/kmap branch from 2399324 to 401c0db Compare April 16, 2026 07:22
Co-authored-by: Eberhard Beilharz <ermshiperete@users.noreply.github.com>
Base automatically changed from chore/common/embed-osk/15752-cleanup to epic/embed-osk-in-kmx April 16, 2026 20:17
@mcdurdin mcdurdin merged commit 24d10d0 into epic/embed-osk-in-kmx Apr 16, 2026
24 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in Keyman Apr 16, 2026
@mcdurdin mcdurdin deleted the feat/developer/embed-osk/kmap branch April 16, 2026 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants