Commit graph

37 commits

Author SHA1 Message Date
Eberhard Beilharz
c9497fd494
feat(common/core): Implement shiftFreesCaps and capsOnOnly 2021-08-06 16:13:58 +02:00
Marc Durdin
d76eca052e fix(common/core/desktop): split smp for context chars
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.
2021-08-06 12:28:15 +10:00
Eberhard Beilharz
0a28af6c83
chore(common/core): Allow shell script for kmcomp
This change allows to build the keyboards on Linux if a `kmcomp`
script can be found in PATH. Otherwise we check for and use `wine`
and `kmcomp.exe`.
2021-08-04 12:25:02 +02:00
Marc Durdin
3b4dfec809 chore(common/core): unit test fixes
Per review comments.
2021-07-28 10:02:39 +10:00
Marc Durdin
60b1cc7545 chore: fixup damaged merge 2021-07-27 08:32:02 +10:00
Marc Durdin
5a94012f01
Merge branch 'chore/common/core/debug-additional-tests' into chore/common/core/5488-delete-markers-reliably 2021-07-27 08:23:24 +10:00
Marc Durdin
1292b407bc
Merge branch 'master' into chore/common/core/debug-additional-tests 2021-07-27 08:17:53 +10:00
Marc Durdin
75ce10510a chore(common/core): address review comments
Also introduce a specific enum for backspace type rather than
inappropriately using the action item type enum.
2021-07-27 07:08:30 +10:00
Marc Durdin
91cde81d35 chore(common/core): extra test for context consistency 2021-07-26 15:29:16 +10:00
Marc Durdin
796a2d4c85 chore(common/core): handle deletion of markers in actions
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.
2021-07-26 15:23:20 +10:00
Eberhard Beilharz
0eca43d4ea
feat(common/core): Implement capsAlwaysOff system store
This change implements the core part in a way that makes the tests
pass. This still needs corresponding changes in the engine.
2021-07-23 10:25:28 +02:00
Eberhard Beilharz
a16b320c17
chore(common/core/desktop): Update readme 2021-07-23 10:16:14 +02:00
Marc Durdin
a8acee1770
chore: Apply suggestions from code review
Co-authored-by: Eberhard Beilharz <ermshiperete@users.noreply.github.com>
2021-07-23 07:18:17 +10:00
Marc Durdin
507c5a4e78 chore(common/core): additional debug tests
Adds some tests for Keyman Core for debugging, verifying contents of
the action list after every keystroke in the test.

Also refactors some of the test helper files to make it easier to
diagnose failing tests and share helper functions.
2021-07-22 20:05:01 +10:00
Marc Durdin
4560ae4f69 feat(common/core): add action_index to all debug events 2021-07-22 16:33:31 +10:00
Marc Durdin
4fbfd33943 feat(common/core): debug action index
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.
2021-07-20 14:07:33 +10:00
Marc Durdin
05971a21cf chore(common): Merge branch 'master' into feat/common/core/desktop/kmx_debugger_events 2021-07-19 04:24:35 +10:00
Marc Durdin
2a0adf27d0 chore(common): Merge branch 'master' into feat/common/core/desktop/kmx_debugger 2021-07-19 03:34:04 +10:00
Marc Durdin
37bb7b77cf feat(common/core/desktop): add debug events
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.
2021-07-08 11:16:58 +10:00
Marc Durdin
e114f31bba chore(common): kmx fixtures need debug symbols 2021-07-08 09:43:19 +10:00
Eberhard Beilharz
69a2e9ec27
refactor(common/core/desktop): Fix file and class names
- rename source files for `kmx_processor` -> `kmx_processor.*`
- rename class `KMX_Processor` -> `KMX_ProcessEvent` with source
  files `kmx_processevent.*`

Closes #5436.
2021-07-07 15:25:15 +02:00
Marc Durdin
b1c0cbf405 chore(common): cleanup cross-platform code 2021-07-06 15:31:01 +10:00
Marc Durdin
2992e1ed83 feat(common/core/desktop): kmx debugger basic infrastructure
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
2021-07-06 15:30:19 +10:00
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