This fixes typing `n>` with sil_ipa keyboard which no longer output
the expected `ŋ` because pressing the shift key reset the context.
For modifier key presses we now exit `KMX_ProcessEvent::ProcessEvent`
early.
This change also removes a redundant line from engine.c. Clearing
the context happens in `reset_context()` again if necessary.
Fixes#5591.
This change improves capslock handling with a capsAlwaysOff keyboard.
Previously, the caps lock indicator was turned on while holding down
the Caps Lock key. With this change we turn it off immediately. This
is done by forcing caps lock off even if the state already seems to
match.
Also, for capsAlwaysOff keyboards skip further processing of caps
lock key after we turned capslock off again.
Fixes#5465.
Fixes#5561.
If a non-BMP Unicode char was emitted into the internal context, it was
being truncated to a WORD, which caused data loss for multi-group
keyboards.
Includes an update to a unit test to validate this fix.
Moves the responsibility for deletion of markers when the users presses
the backspace key, from `kmx_processor::process_event` to
`KMX_ProcessEvent::ProcessGroup`. This has no effect on usage of Keyman
Core, but:
1. Simplifies the association between context and action further
2. Ensures that `m_actions` and `state->actions` will always be the
same length, making future refactoring of these simpler
3. Allows us to use the index into the m_actions array for Debug events,
which simplifies the interleaving of these for the upcoming Debugger.
When the user presses backspace at start of context (where there may be
markers in the cached context, but no characters), the kmx processor
will delete any markers prior to insertion point before requesting that
the consumer emit the backspace virtual key back to the application, to
allow the application to handle backspace at start of text.
Fixes#5488.
This updates Keyman Core, corresponding tests, and Keyman Engine for
Linux to support deletion of markers through an action, ensuring that
the action queue does not desynchronize with the context.
Adds an action_index to each debug event (not all debug events
need it). This allows the debugger to partially execute a rule
including the possibility of multiple updates to context.
Adds debug events to the kmx processor and corresponding unit tests.
This corresponds largely to the way that keyman32 emits debug events,
but with one key change: debug events in keyman32 are processed
synchronously, whereas in Keyman Core, the full set of debug events will
be returned alongside the final action list for the key event.
Given this difference, there will likely need to be some more data
returned in individual debug events, specifically around intermediate
context manipulation, as required for step-by-step debugging. However,
that will come in a subsequent PR.
Part of #5013.
Adds all the debug infrastructure:
* public API headers
* public API implementation classes and functions
* basic unit tests
* helper classes for recording debug events
* minimal implementation of kmx-specific debug event signalling --
just BEGIN and END events.
* tangential: unit test assertion macros and coloured output
Splits the rust source into a core library crate, and two interface
library crates - native and wasm. This avoids requiring WASM
dependencies on systems that don't require them, such as Debian
autopackagers.
Relates to #5069.
* Adds infrastructure for building keyboard_processor to WASM
* Updates unit tests to work in WASM environment
* Cleanup of documentation
* Consolidation of build script for most platforms
Relates to #5069.
This establishes a baseline Rust build environment and linkage with
common/core/desktop.
This includes:
* build script build.sh which handles builds on Windows, macOS, *nix,
with multiple targets on Windows only at present (M1 on mac to come
when we do the mac integration work.)
* a mock rust processor with a very stubbed-out implementation
* bare bones interface between Rust library and C++ code
* unit tests on Rust and integration tests on C++ side to test the
linkage between the libraries.
This should deliver a set of libraries that can be linked into our
target applications. For ease of deployment, it may be best to make
these static libraries, but I haven't made that decision at this point.
Matches work completed in #5169 for Keyman Core, kmx_file.cpp.
While this code will hopefully disappear in 15.0, it's good to make sure
we aren't diverging beforehand.
Also tidies up a couple of other cases in `CopyKeyboard` in Keyman Core.
This change fixes the FixupKeyboard method. In the .kmx files on
disk array pointers for an empty array point to the end of the file
(one byte after the end of the data structure). When we expand the
pointers in FixupKeyboard this leads to `cgp->dpKeyArray` to point to an
unallocated memory location - this shouldn't matter since we don't
try to read or write at this location if the Key array is empty,
but armhf still seems to raise a SIGBUS, probably because we cast
the value to a `LPKEY`. This change sets `cgp->dpKeyArray` to `NULL`
if we have an empty key array, similar to what's done for the strings.
Closes#5072.
Compiling on armhf outputs two warnings:
- NULL used in arithmetic [-Wpointer-arith] (line 289 and 290)
- unused parameter ‘dwFileSize’ [-Wunused-parameter] (line 264)
(related to #5072)
Fixes#4591.
I fixed incxstr in 4 places:
1. Common/Core: kmx_xstring.cpp
2. Engine: xstring.cpp
3. Test project importkeyboard importkeyboard.cpp
4. Test project m-to-p m-to-p.cpp
I updated mcompile to remove its own copy of incxstr (identical to that
in xstring.cpp) to reduce WETness but opted not to do so for the test
apps, which are pretty much throwaway anyway.
I note that there is more work we could do here; we need to check every
character as we increment so we don't miss a `U+0000` end of string with
malformed data. But I would like to tackle that as a separate job at
some point in the future after Core integration.
We have a `g_debug_ToConsole` variable. However, so far this was
always set to true and output to `syslog`. This change modifies
the default to `false`, and in that case logs to `syslog`. If
`g_debug_ToConsole` is true we no output to the console.
When running the KMX unit tests we set `g_debug_ToConsole` to true.
Turns out that @darcywong00's suggestion for a test case was a Very Good
Idea. The SMP handling in Keyman Core had an egregious bug where only
half of a surrogate pair was being deleted in the UTF-16 context; see
kmx_processor.cpp 425-428. This was then masked by the test runner
masking the damage in the original test case; see kmx.cpp 193-203.
The new test case exercises a number of additional ways of manipulating
the context where surrogate pairs exist, to show we handle the deletion
properly within Keyman Core and in the test runner.
Matches the work in #4360 for Windows, tweaks to documentation.
Note that this does not add the BK_SURROGATE flag at this point. I
will add that in a future update if it proves necessary, when working on
the core integration into Windows.