Fixes#5464.
The keyboards repository already has code to validate .xsd files, using
xmllint. This adds the same functionality directly into kmcomp and TIKE.
Fixes#5609.
If a user attempted to export the OSK to a BMP or PNG, and their base
keyboard was a European layout (102 key), then Keyman Developer would
crash as it attempted to recalculate and redraw the keyboard when
constructing the OSK object, and there would be no window for the
OSK object to draw to (or measure dimensions against).
This fix uses a temporary off-screen canvas to facilitate calculation of
dimensions, and avoids drawing or invalidating if no window is
available.
Fixes#5718.
The debugger memo control will now filter out action shortcut keys such
as Ctrl+A, Ctrl+O, so that the keyboard being debugged can get the first
chance to look at them and handle them if it wishes.
If the keyboard does not handle the keystroke, then a set of editor
shortcut keys will be handled by the debugger, namely:
* Ctrl+A - select all
* Ctrl+C - copy
* Ctrl+V - paste
* Ctrl+X - cut
* Ctrl+Z - undo
Note that undo semantics are a little weird with the debugger, but that
is not related to this fix. By a little weird, I mean that characters
emitted by the keyboard being debugged do not flow into the undo buffer,
so undo often has no effect. I am not planning to fix this idiosyncrasy
at this time.
* Adds a taskbar icon to highlight to user when Keyman Core library is
in use, with a crummy core.ico. This visual feedback will be removed
in late beta.
* Renames the 'use common core' registry setting to match other flags
* Adds a System Setting to make the Keyman Core setting visible in
System Settings and kmconfig.
On Windows 7, we will no longer attempt to canonicalize BCP 47 tags in
the same was as on later OS versions, because there appear to be some
significant differences in how they work, for example, zh-CN is not
converted to zh-Hans-CN on Windows 7, whereas it is on Windows 10.
This commit also refreshes the `KLog` unit which is useful for debugging
these types of scenarios.
Add test fixture to allow Setup and Teardown methods to be used
for all km process action tests.
Modified the DebugAssert macro to not do the early return on its own.
Makes it possible to run the kmlmc.cmd compiler wrapper script from
Keyman Developer while debugging from source.
Adds a new class `TKeymanDeveloperPaths` which is similar to
`TKeymanPaths`, to provide a future single location for all Keyman
Developer path-related functions. There are a number scattered through
the source at present, e.g. in `RedistFiles.pas`, so this is just a
starting point.
Fixes#5695.
When the debugger is in single-step mode, reflects the value of option
stores at the time of the change rather than at the beginning of the
batch.
Fixes#5683.
If `store(&name)` is missing from a keyboard, then fallback to the
filename of the keyboard (sans extension). This fixes a regression in
14.0 keyboard registration.
I opted not to make this change in kmxfile but rather in places which
use it in the Keyman Engine COM API, because I wanted kmxfile to remain
truthful about all details of what it is reading from the file.
Given that the COM API will now never return an empty string for the
name of the keyboard, there are mitigations for this in Keyman
Configuration which are unnecessary, but it is not harmful for them to
remain there.
Will cherry-pick to stable-14.0.
Fixes#5642.
Relates to #5013.
This adds support for viewing and setting keyboard options in the
debugger. This initial implementation does not have 100% coverage of
keyboard options; specifically:
1. keyboard options are not saved between debug sessions.
2. in single-step debugging, the keyboard options will be shown as
updated at the start of a keystroke batch, not when the rule which
calls `set()` is fired. This level of granularity is not currently
visible from the engine. It does not impact the correctness of the
rule processing, only the view of the current state of the keyboard
option.
I do not anticipate supporting either of those functions in 15.0.
This commit renames the existing `TfrmDebugStatus_Options` to
`TfrmDebugStatus_Platform`. I had originally planned to show both the
platform and keyboard options in the same debug status window, but for
space reasons I have split them. (I'm sorry if this makes reading the
PR a little more challenging.)
There is a significant amount of rewriting of kmxfileutils.pas and
debugkeyboard.pas. This extends support for working with kmx files and
modernises the code (e.g. using generics for list types).
Note in particular the `ExpandSentinel` function in kmxfileutils.pas.
This is copied from CompileKeymanWeb.pas but has different internal
references, so cannot be used as-is -- CompileKeymanWeb works with
intermediate object 'files' from the kmx compiler, whereas the debugger
works with final binary .kmx files which have a different in-memory
layout. It may be possible to unify this in future but that would
involve additional risk. (Seriously, I would probably prefer to rewrite
CompileKeymanWeb.pas in C++, Rust or TypeScript than to invest in
merging these two use cases.)
Relates to #5013.
Adds a debug status page to allow the user to select an alternative
platform so they can debug rules relating to those platforms which
are constrained by the `platform()` statement in the keyboard source.
Note that while touch platforms are listed here, there is not yet any
method of activating touch key events (e.g. `[T_foo]`). This
functionality is planned for a future update.
Relates to #5013.
If user presses F6 in the debugger (while not in run mode), will now
switch to editor view, and vice-versa.
Also fixes the inversion of the focus test in CEF so that focus controls
work correctly for web hosts.
Relates to #5013.
Before starting on new functionality in the debugger, I wanted to
cleanup a bunch of bits and pieces, including:
1. Correct handling of text selection and deletion
2. Refactor of character grid at bottom of debug window
3. Deadkey realignment after text changes
4. Correct tracking of cursor position between events
5. Handling a few destruction edge cases
Fixes#5574.
When a user presses Win+M, Win+D, or clicks the desktop button on the
taskbar, all windows get minimized, even those that do not have the
WS_MINIMIZE flag. Delphi modal dialog forms are not expecting this, and
do not restore correctly later.
This scenario arises only when a form is created with a `nil` owner and
then `form.ShowModal` is called.
The fix was already implemented on Splash and HTML forms, but
differently; I have chosen to use the implementation from the Splash
form as it is simpler and seems to work correctly.
Refactors visual keyboard import from kmx to use Keyman Core, and at the
same time removes any UI interactions or direct Windows dependencies
from the process.