Fixes#7425.
In the layout editor, the "Select Key" dialog was being shown sometimes
when using shortcuts such as Ctrl+V. The reason this happened was that
the shortcut handler in Delphi was capturing the keydown of the V key,
so the Ctrl event handler never saw it. Then, if you pressed Ctrl+V, and
released the Ctrl key before releasing the V key (which often happens
when you press a shortcut rapidly), the Ctrl event handler would receive
notification of the Ctrl key release and trigger the "Select Key"
dialog.
This fix shifts the Ctrl key event handler out of the keyboard editor
and into the top-level application events handler -- this is the best
place where we can preview key events before they are passed to the
shortcut handler and controls for processing.
This necessitated adding a general `ControlKeyPressedAndReleased` event
function to the TIKE editor base class. This is currently only used by
`UfrmKeymanWizard` and `UfrmOSKEditor`.
I noted that the OSK editor did not currently support the Ctrl key
event to select a new key. As a part of this fix, I added support for
this, to bring it into line with the Layout Editor and the Touch Layout
Editor.
Relates to #4324 (but slightly orthogonal.)
We wanted some message classes to be handled in the lexical model editor
more cleanly, including drill-down to line of error. A few changes
required to make this work well:
1. Parse error messages from kmlmc. This is not perfect but works while
the two projects are kept in sync, which they always are for Keyman
Developer. Note that at this stage, .ts warnings are not captured in
this parser, as they are generated by tsc.
2. Drill-down in Wordlist Editor Frame to find line of error
3. Model editor reports ownership of .tsv files so they can be loaded
4. In case of model editor not open (e.g. building from project view),
the TSV standalone editor was not displaying the frame, so it never
actually worked.
5. If the text editor had never loaded, then FindError was effectively
a no-op; adds code to seek to error line after page load finishes.
6. Ensures that if we attempt to seek an error in a sub-file owned by
an editor (e.g. .tsv owned by .model.ts, .kvks owned by .kmn), that
the parent editor will be focused first. Does not verify all paths
here, just the tsv one.
Fixes#7005.
If a developer used single digit values in stores, unquoted (which is
not really the usual approach, but should work just fine for non-zero
values), the KMW compiler would emit invalid single-digit hexadecimal
escapes for them, e.g. `"\x1"` instead of `"\x01"`.
Sample code:
```
store(option) 1
if(option = 1) + 'a' > 'one'
if(option = 2) + 'a' > 'two'
+ '1' > set(option = 1)
+ '2' > set(option = 2)
```
It is not immediately obvious from this code, but the value `1` is
actually a character with value `'\x01'` or `U+0001`!
The more usual approach will not encounter this problem:
```
store(option) '1'
if(option = '1') + 'a' > 'one'
if(option = '2') + 'a' > 'two'
+ '1' > set(option = '1')
+ '2' > set(option = '2')
```
Note that the following is a compile error (due to internal use of
null terminated strings).
```
store(option) 0
```
Fixes#7090.
Fixes#7091.
While kmcomp loads most files just fine when paths with forward slashes
are passed in, it fails to parse target path correctly when building one
file out of a project.
For example, if the user runs:
```
kmcomp.exe -t khmer_angkor.kmn release/k/khmer_angkor/khmer_angkor.kpj
```
Then the following error arises:
```
khmer_angkor.kps: Error: 0001 Validation error: The system cannot find the path specified.
khmer_angkor.kps: Failure: Package C:\Projects\keyman\keyboards\source\khmer_angkor.kps had validation errors.
```
This patch ensures all paths passed in as command-line parameters are
converted to backslashes, matching the expected Windows format. While I
only needed to fix the `FParamTarget` parameter in order to address the
reported issues, for consistency I applied the same fix to all input
paths.
Removes Keyman Developer Server's transitive dependency on dicer by
updating multer to `1.4.5-lts.1`, which updates its dependency on
busboy.
See
https://github.com/expressjs/multer/pull/1097#issuecomment-1141286771
for reasoning behind use of `-lts.1` rather than a full release
version.
At some point in the future, multer will publish a full release with
this fix, at which point we can move back to a full release version.
Fixes#7028.
Note that the desktop layout is not currently used by KeymanWeb. The
designer has a number of additional issues, as the .keyman-touch-layout
format is not well suited to describing a fixed hardware layout, but
fixing this is outside the scope of this issue.
Fixes#7216.
The warning message 0x209A 'The rule will never be matched because its
key code is never fired.' was being generated multiple times for a
single line because the `JavaScript_Key` function it is generated by is
used for various purposes.
This PR keeps a cache of reported key rules to ensure that the message
is reported only once for a given key rule, and also improves the
reporting to clarify which specific key is unreachable, which makes it
easier to diagnose when using `any(k)` style messages, for example:
```
lao_phonetic.kmn (237): Warning: 209A The rule will never be matched for key 'ñ' because its key code is never fired.
```
This also reduces the warning to a hint, as this should not be a
blocking issue for a keyboard, rather just a place the keyboard author
can tidy up.
Fixes#7122.
The compiler was updating currentLine when checking for unreachable
rules, but not restoring it afterwards. This led to mismatches in the
debugger and in compiler warnings.
Fixes#7030.
Prevents a stack overflow / loop when the web target is removed from a
keyboard and it has already been tested on web, and the user presses the
Compile button.
When rebuilding a model, Keyman Developer would query for the
registered model, but a missing simplifyId call meant that it never
matched the model name (due to `.` vs `_`).
Picked up while reviewing code for conversion to C++. The compiler
could, in some circumstances emit garbage code for readonly groups
because we weren't testing all scenarios correctly. In practice, this
would have been rare as readonly groups don't emit characters, but it
should be fixed!
Fixes up scripts (except under /linux) to use `#!/usr/bin/env bash`
instead of `#!/bin/bash` or `#!/bin/sh` so that we don't end up with
the ancient version of bash supplied with macOS.
This became urgent with this PR, because of bash-4.xisms in
build-utils.sh, for example on line 572:
```
if [[ -v _builder_params[$e] ]]; then
```
If Server is shut down, Keyman Developer now handles this better
and offers to restart it in UI interactions, and backs out quietly
in non-UI processes.