feat(developer): add kmap support to KMX+ kvk and keyman-touch-layout 🔱#15821
feat(developer): add kmap support to KMX+ kvk and keyman-touch-layout 🔱#15821mcdurdin merged 3 commits intoepic/embed-osk-in-kmxfrom
Conversation
User Test ResultsTest specification and instructions User tests are not required |
| return layerBags; | ||
| } | ||
|
|
||
| private addKmap(keys: KMXPlus.Keys, newKey: KMXPlus.KeysKeys, vkey: number, mod: number) { |
There was a problem hiding this comment.
Better name might be addToKmap (or even addToKeymap or addKeyToKmap)
|
|
||
| assert.isArray(keys.kmap); | ||
| assert.isEmpty(keys.kmap); | ||
| assert.lengthOf(keys.kmap, keys.keys.length); |
There was a problem hiding this comment.
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.
4be89fe to
c985808
Compare
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
2399324 to
401c0db
Compare
Co-authored-by: Eberhard Beilharz <ermshiperete@users.noreply.github.com>
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
getModifierStateandgetStateFromLayerfunctions into a cleanermodifierStringToStatefunction, and move from web into common.Marks existing functions as deprecated but does not update usage at this time.
Test-bot: skip