when vectors are resized the memory is realocated so all the option
pointers become invalid. Using a deque avoids this it has all the same
methods so it is straight replacement.
fixes: #15961
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.
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
fix(core): fix keydown/up handling for LDML keyboards
For LDML keyboards this change fixes the `emit_keystroke` flag so that it always has the same value for the KeyDown and the KeyUp event. This fixes some problems with stuck keys. Previously we would set `emit_keystroke=TRUE` on KeyDown but `emit_keystroke=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.
Follows: #15656Fixes: #15569Fixes: #15550
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: #15569Fixes: #15550
This documents the state of `km_core_actions.emit_keystroke` for
different keys pressed. Also some cleanup in other docs.
This documents the state after merging #15609 (for ldml keyboards) and
NN (for kmn keyboards).
Follows: #15609
Build-bot: skip
Test-bot: skip
This replaces and enables the commented `k_000_null_keyboard` test which
didn't work because keys that are not on any layer don't produce output.
This instead defines a minimal keyboard with just two keys and then tests
typing a key that is on the keyboard followed by a key not on the keyboard.
Test-bot: skip
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
Production code uses a list of context items, so this change modifies
the tests to also use a list instead of a vector to more closely match
production code.
Addresses code review comment.
Test-bot: skip
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
chore(core): update API `changes.md` document 🎼
Turns out we have a document for the API changes, in addition to the release notes. That document got overlooked so far. This change now updates that doc with the API changes that happened since v17.
Follow-up-of: #15471
Follow-up-of: #12769
Turns out we have a document for the API changes, in addition to the
release notes. That document got overlooked so far. This change now
updates that doc with the API changes that happened since v17.
Build-bot: skip
Test-bot: skip
Follow-up-of: #15471
Follow-up-of: #12769
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: #15491Fixes: #15505
Follows: #15488
Relates-to: CLDR-19218