Commit graph

14 commits

Author SHA1 Message Date
Marc Durdin
0cbd91f6ce feat(common): keyboard_processor wasm build
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
2021-06-08 08:35:59 +10:00
Marc Durdin
3d2d31a717 chore(common): remove some warnings 2021-06-02 13:52:00 +10:00
Marc Durdin
fdbc2a309a chore(common): stub out tests to prevent build errors 2021-06-02 13:51:54 +10:00
Marc Durdin
8052ac9bbc feat(common): Rust infrastructure
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.
2021-06-02 13:51:50 +10:00
Eberhard Beilharz
044e53198a
fix(linux): Fix switching to keyboard in middle of line (#4678)
Don't re-set context if it changed because the cursor location was
wrong. When the user switches to the EuroLatin keyboard in the
middle of the line, we're getting a wrong cursor location. This will
be fixed with the next keypress, but it leads to the context string
suddenly having more characters added to the front. If we re-set the
context because it's different now we will loose the information we
previously added to the context.

We now compare the end of the string. If the new context string ends
with the old context string we assume that the cursor position got
updated and don't re-set the context.

This fixes #4678.
2021-03-18 17:29:21 +01:00
Eberhard Beilharz
2421af506e
chore(common): write debug output to console
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.
2021-03-02 16:55:22 +01:00
Eberhard Beilharz
2593c7873f
docs(common): Add readme for unit tests 2021-03-02 16:55:22 +01:00
Marc Durdin
1ec9577613 chore(windows): fix typo 2021-01-29 16:14:24 +11:00
Marc Durdin
081471218e fix(common): add test case and fix smp bugs
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.
2021-01-29 16:05:07 +11:00
Marc Durdin
367fe409a9 fix(common/core): context mismatch with if and deadkey automatic test 2021-01-18 10:22:59 +11:00
Marc Durdin
080f03860e
Merge pull request #3083 from keymanapp/fix/windows/2759-force-output-keystroke-fails
fix(windows): force output keystroke failure
2020-05-11 06:09:09 +10:00
Marc Durdin
5956674a43 chore(common): add tests for Keyman Core 2020-05-08 16:53:53 +10:00
Marc Durdin
3f98c6027b fix(windows): decxstr was not checking start of string properly 2020-05-04 16:18:31 +10:00
Darcy
660a1459ff refactor(common): Rename keyboardprocessor to desktop 2020-02-26 16:34:29 +07:00