-
-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(developer): ldml scan codes support 🙀 #9615
Conversation
For: #9403 - unicode-org/cldr:f16d66601f309f29a64a897282fdcab440d42661 - No local modifications neded1
For: #9403 - read implied imports for scancodes
For: #9403 - use Symbols to track import status
For: #9403 - improve how forms are read in the XML structure - warnings when custom (non-default-import) scancodes are loaded - error, as usual, when an unknown form is present
For: #9403 - unit test the set and row count for codes - fix errors!
User Test ResultsTest specification and instructions User tests are not required Test Artifacts
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not quite ready to approve this, sorry!
static impliedImport = Symbol.for('@keymanapp:implied_import'); | ||
/** item came in via import */ | ||
static import = Symbol.for('@keymanapp:import'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This introduces a new namespace that we need to be careful with -- the @keymanapp
Symbol namespace. Conceptually I think it is fine but I am just a little wary about future trouble with it. Might be good to use a longer prefix, for disambiguation e.g.:
static impliedImport = Symbol.for('@keymanapp:implied_import'); | |
/** item came in via import */ | |
static import = Symbol.for('@keymanapp:import'); | |
static impliedImport = Symbol.for('@keymanapp:common/ldml/implied_import'); | |
/** item came in via import */ | |
static import = Symbol.for('@keymanapp:common/ldml/import'); |
Also, just verifying is this just a way of tagging arbitrary structures with an "imported" flag? And you wanted to use this to avoid potential stumbling blocks in the way we use those structures, because it won't be an interable key on an object?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On reflection, I think this doesn't need a named symbol at all. this symbol should be used only within one run of kmc. it doesn't need to be independently detected. I will drop the namespace.
yes, it's just a way to tag the structure as imported - it's not iterable on the object, it doesn't affect the API at all at any level. It's metadata answering the question "how did this data object come in?"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK here?
developer/src/kmc-ldml/test/fixtures/sections/layr/hint-custom-form.xml
Outdated
Show resolved
Hide resolved
resources/standards-data/ldml-keyboards/techpreview/import/scanCodes-implied.xml
Outdated
Show resolved
Hide resolved
For: #9403 - per review comments - track CLDR PR 3282
@mcdurdin ptal |
- use vkey k.K_oE2 for 0x7D in KS and JIS keyboards For: #9403
i'm temporarily skipping the scancode test— to show that the LDML updates are otherwise passing. |
temporary file output => https://gist.github.com/srl295/48685c96bb23ee19ce1f14428ed5d91c {
"scan": "0A",
"vname": "K_9",
"vcode": 57
},
{
"scan": "0B",
"vname": "K_0",
"vcode": 48
},
{
"scan": "0C",
"vname": "K_HYPHEN",
"vcode": 189
}, |
That works, a bit verbose, but certainly easy to work with. It will be a separate generated file? Evil alternative: const scancodes = [
["0A","K_9",57],
["0B","K_0",48],
["0C","K_HYPHEN",189]
].map(x => ({scan:x[0], vname:x[1], vcode:x[2]})); |
@mcdurdin PTAL at progress but TODO:
Is there any other checking needed? |
except we already have dups. |
- spec: 'hardware' is no longer an enum but a str. Ripple effects here. - custom scancodes and layouts are, interestingly, supported. But it's a warning. - tests for bad scancodes. Fixes: #9403
Okay, PTAL.
|
This would only be a problem if both |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Co-authored-by: Marc Durdin <[email protected]>
Maybe I should exclude this specific dup. |
Sounds sensible -- then we can track if future dups appear. |
common/web/types/test/ldml-keyboard/test-ldml-keyboard-xml-reader.ts
Outdated
Show resolved
Hide resolved
- fixes to the special case test Fixes: #9403
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Changes in this pull request will be available for download in Keyman version 17.0.185-alpha |
vkeys
, see feat(core): ldml vkey support 🙀 #7135kmc
from tests.Fixes: #9403
@keymanapp-test-bot skip