Commit graph

690 commits

Author SHA1 Message Date
Marc Durdin
729c71d64d chore: minor cleanup prior to merge of web-core preflight
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
2026-05-28 14:16:19 +02:00
Marc Durdin
39fba5e29c chore(core): fixup const cast 2026-05-27 15:17:48 +02:00
Marc Durdin
6a98a39b8a
Merge branch 'master' into chore/web-core-preflight 2026-05-27 22:37:12 +10:00
rc-swag
4e4dfe7275 fix(windows): add cstring include to action.cpp
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
2026-05-19 14:01:06 +10:00
rc-swag
c0a29a32f7 fix(core): remove white space and comments
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
2026-05-14 16:28:59 +10:00
rc-swag
33cddff16e fix(windows): deep copy for state object
This commit update the state object to have a deep copy for the
action_struct member. The tests have been modified but have
a few issues however this branch is out of date with the refacted
master branch for unit tests. This commit gets the main change in
a future commit will update the tests.
2026-05-12 18:03:46 +10:00
rc-swag
bd1e404ae4
Merge branch 'master' into fix/windows/15857/caps-indicator-switched-off-select
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
2026-05-06 10:47:24 +10:00
rc-swag
28d2c98030 fix(windows): rename local variable no actions
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
2026-04-27 10:39:34 +10:00
rc-swag
874c2509b0 fix(windows): initialise action object in contructor
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
2026-04-24 10:40:45 +10:00
rc-swag
986ee97cb3 fix(windows): add apply actions call to core_event
add apply_actions_and_merge_app_context to km_core_event parent.
This ensures any actions as result of the km_core_event are applied
and actions object updated.

Fixes:#15857
2026-04-23 15:04:51 +10:00
Marc Durdin
8311c65077
Merge branch 'epic/web-core' into auto/A19S25-merge-master-into-web-core 2026-03-27 16:30:55 +11:00
Eberhard Beilharz
aa36cfe961
fix(core): address code review comments
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
2026-03-24 12:43:11 +01:00
Marc Durdin
70c54b0b40 chore: Merge branch 'epic/web-core' into auto/A19S24-merge-master-into-web-core
Some checks are pending
Keyman Build Summary / Summarize build status checks (push) Waiting to run
2026-03-16 04:49:38 +01:00
Eberhard Beilharz
9836070299
fix(core): clarify and extend comment 2026-03-02 17:43:34 +01:00
Eberhard Beilharz
67468c4dce
fix(core): address code review comments
Co-authored-by: Marc Durdin <marc@durdin.net>
2026-03-02 17:28:19 +01:00
Eberhard Beilharz
382b5d45e3
fix(core): fix keydown/up handling for LDML keyboards
For LDML keyboards this change fixes the `emit_key` flag so that it has
the same value for the KeyDown and the KeyUp event. This fixes some
problems with stuck keys. Previously we would set `emit_key=TRUE` on
KeyDown but `emit_key=FALSE` on KeyUp for frame keys. This caused Linux
to never see the KeyUp event, resulting in a stuck key.

Also add unit tests that verifies that the actions that we get after
calling `km_core_process_event` are what we expect.

Fixes: #15569
Fixes: #15550
2026-03-02 17:27:36 +01:00
Eberhard Beilharz
2bd6cfd735
refactor(core): rename fields to start with underscore
Test-bot: skip
2026-03-02 17:27:15 +01:00
Eberhard Beilharz
d8a5f694da
refactor(core): fix whitespace
Build-bot: skip
Test-bot: skip
2026-03-02 17:26:14 +01:00
Eberhard Beilharz
3c525cc244
chore: Merge branch 'epic/web-core' into auto/A19S23-merge-master-into-web-core 2026-02-27 10:19:18 +01:00
Eberhard Beilharz
b405bf5842
refactor(core): simplify loop for removing text
Instead of using an iterator to loop over the context items, incrementing
a counter on each iteration, and then finally removing the calculated
number of context items from the list, this change loops through the list
and looks at the last context item, removing it if necessary.

Follows: #15596
Test-bot: skip
2026-02-18 17:34:02 +01:00
Eberhard Beilharz
32bb1c8502
fix(core): fix iterator in backspace handling
This change replaces the reverse iterator loop that holds a stale iterator
across `pop_back()` calls with a pattern that directly accesses
`context.back()` on each iteration. This avoids undefined behavior from
iterator invalidation when mutating the list or vector.

While so far the previous code didn't show problems, it might still access
released memory depending on the implementation. The documentation for
`pop_back()` says "References and iterators to the erased element are
invalidated", so the previous implementation was clearly wrong.

Test-bot: skip
2026-02-18 15:58:45 +01:00
Marc Durdin
90f77bdbd6
Merge pull request #15589 from keymanapp/auto/A19S22-merge-master-into-web-core
auto: A19S22 merge master into web-core 🎼
2026-02-13 18:28:40 +07:00
Marc Durdin
ed63b70bb4
Merge branch 'epic/web-core' into auto/A19S22-merge-master-into-web-core 2026-02-13 11:08:05 +07:00
Marc Durdin
74d1bc8fc2 chore(core): address review comments
Co-authored-by: Darcy Wong <darcy_wong@sil.org>
Co-authored-by: Eberhard Beilharz <ermshiperete@users.noreply.github.com>
2026-02-01 06:47:49 +11:00
Marc Durdin
766c6992ed fix(core): normalization segment should end on NFC boundary, not NFD
When normalizing, we need to stop processing on an NFC boundary, not an
NFD boundary, to support normalizations such as in Bengali, where
appending `U+09D7` to a context of `U+0995 U+09C7` should result in
`U+0995 U+09CC`.

The specification is unclear on this; see https://unicode-org.atlassian.net/browse/CLDR-19218

This also updates the ldml keyboard unit test suite to support running
in full NFC mode (used in all Engine implementations) as well retaining
the NFD mode (now only used by the debugger).

Side note: the Bengali normalization failure case was picked up by the
improvements to the unit test suite, proving once again that good tests
are so valuable.

Fixes: #15491
Fixes: #15505
Follows: #15488
Relates-to: CLDR-19218
2026-01-28 14:32:25 +11:00
Marc Durdin
033e3eeb3f docs(core): add comments post review
Co-authored-by: srl295@gmail.com
2026-01-27 10:50:26 +11:00
Marc Durdin
f7cd0c41ba fix(core): handle backspace decomposition
Ensure that when a single backspace decomposes the last NFC character in
the app context, the remainder of the 'cluster' is preserved, matching
the implication of the CLDR keyboard specification.

This addresses the behavior in #15487 where the cached context became
out of sync with the app context after deleting an entire NFC cluster
such as ê, which caused a loop ending up with the entire context being
deleted, at which point the loop exited with a fail-safe.

Note that the LDML keyboard tests (ldml.cpp) do not currently exercise
the normalization code; this is a gap that should be addressed to ensure
that we are testing final application behavior.

Fixes: #15487
2026-01-25 07:24:15 +11:00
Eberhard Beilharz
de49944aa7
chore(web): remove keyboard_attributes._folder_path 2026-01-21 18:27:37 +01:00
Eberhard Beilharz
0422b3f912
chore(core): Remove km_core_keyboard_attrs.folder_path
PR #12769 removed `km_core_keyboard_load` that allowed loading a keyboard
from a path. Instead we now pass a BLOB to core to load a keyboard.
With the function gone there is no longer a need to have a field with the
path.

Follow-up-of: #12497
Related-to: #12769
Test-bot: skip
2026-01-20 15:17:38 +01:00
Eberhard Beilharz
83dca0f779
feat(core): address code review comments
Test-bot: skip
2026-01-19 16:28:52 +01:00
Eberhard Beilharz
9909d7d901
feat(core): expose km_core_state_options_update to WASM
Part-of: #13426
Test-bot: skip
2026-01-15 12:28:56 +01:00
Eberhard Beilharz
654f1b2103
chore(web): Merge remote-tracking branch 'origin/epic/web-core' into feat/web/15283_keydown 2025-12-09 20:06:48 +01:00
Eberhard Beilharz
588d08cb90
test(web): address code review comments
- include `km_core_actions_wasm.toString` only for debug builds
- simplify waiting on KMW fully initialized

Test-bot: skip
2025-12-09 17:28:11 +01:00
Eberhard Beilharz
191964260f
feat(web): properly set keyDown flag
This change passes the right value to the `is_key_down` parameter of
Core's `process_event`. It also updates the WASM interface to accept
a boolean instead of a number, and adds the enum values for the core
event flags.

Fixes: #15283
Test-bot: skip
2025-12-05 19:18:15 +01:00
Eberhard Beilharz
7467584364
feat(web): add km_core_actions_wasm.toString() 2025-12-01 16:08:53 +01:00
Eberhard Beilharz
937460b104
feat(web): expose km_core_context_get/set to WASM
Test-bot: skip
2025-11-12 19:50:29 +01:00
Marc Durdin
aa6b3c328e chore: Merge branch 'epic/web-core' into auto/A19S15-merge-master-into-web-core 2025-11-07 14:23:43 +01:00
Marc Durdin
55d6efe482 fix(developer): prevent ANSI keyboards crashing debugger
Note: #11909 has some additional future cleanup we could do, but these
code paths are not currently accessible, so in the interest of moving
forward, am leaving them for now.

Fixes: #11909
Test-bot: skip
2025-10-24 14:45:17 +02:00
Marc Durdin
7c42887ead
Merge branch 'epic/web-core' into chore/merge-master-into-web-core 2025-03-31 12:13:48 +07:00
Steven R. Loomis
9989217f9e feat(core): improve kmxplus validation
- restructured validation calls to be more consistent

Fixes: #9446
2025-03-17 12:09:04 -05:00
Steven R. Loomis
0011a2d10d feat(core): improve kmxplus validation
- improve an output string
- catch BMP noncharacters besides U+FFFF (H/T @mcdurdin - this was the whole point of the PR) plus test

Fixes: #9446

Co-authored-by: Marc Durdin <marc@durdin.net>
2025-03-17 11:26:57 -05:00
Steven R. Loomis
f1b3555114 feat(core,docs): improve kmxplus validation
- improve how validation works - a missing section does not mean an invalid section. distingush these.
- propagate errors for invalid sections
- update documentation of required sections

Fixes: #9446
2025-03-14 15:37:23 -05:00
Steven R. Loomis
cd002441e5 feat(core): check non-extended keys for bad unicode
- add test case
- turn this into not be an assert, so we can test it

Fixes: #9446
2025-03-14 10:04:21 -05:00
Steven R. Loomis
2e7b5b1417 feat(core): check non-extended keys for bad unicode
- also, use U+FFFD in core if it's a bad char

Fixes: #9446
2025-03-14 09:31:38 -05:00
Steven R. Loomis
b2c3a46283
feat(core) Update core/src/ldml/ldml_processor.cpp
map bad chars to U+0020

Co-authored-by: Marc Durdin <marc@durdin.net>
2025-03-14 09:23:37 -05:00
Steven R. Loomis
2e50282087
Merge branch 'master' into feat/core/9446-detect-bad-unicode-kmxplus 2025-03-14 09:19:03 -05:00
Marc Durdin
068da83e50 chore: Merge branch 'epic/web-core' into chore/merge-master-into-web-core 2025-03-14 11:05:17 +07:00
Marc Durdin
c35e0dac5f chore: Merge branch 'epic/web-core' into chore/merge-master-into-web-core 2025-03-14 11:02:37 +07:00
Steven R. Loomis
d9602cede1 feat(core): assert that no noncharacter emitted from ldml_processor
- not counting markers, which have a special path

Fixes: #9446
2025-03-13 17:22:37 -05:00
Steven R. Loomis
1132fe5845 feat(core): tests for check on load for valid kmx_plus unicode
- turn off some asserts- makes untestable
(there are asserts at 'higher levels' such as loading the entire kmx+)
- add a test with a synthesized COMP_KMXPLUS_STRS - a valid and an invalid one

Fixes: #9446
2025-03-13 17:15:21 -05:00