Commit graph

882 commits

Author SHA1 Message Date
Marc Durdin
35d1d2dde8 chore: sentry.io dsn 2021-10-04 15:23:31 +11:00
Marc Durdin
1daa311802 fix(developer): ensure file modified after import from layout
Fixes #5577.

This ensures that the touch layout file is marked as modified after
running Import From Layout in Keyman Developer, so that changes are
not lost when you save.
2021-09-10 14:22:56 +10:00
Marc Durdin
f5a314b32a chore: correct example 2021-06-17 04:52:05 +10:00
Marc Durdin
f8a49bd0dc fix(developer): kmconvert help match reality
Cherry-pick from #5298.

kmconvert built-in help was missing `-targets`, and the parameter
checking was skipping the last parameter (which only mattered if the
last parameter was `-nologo`, but still...).
2021-06-17 04:46:35 +10:00
Marc Durdin
28ad0af134 fix(developer): support spaces in regression tests
Fixes #5216.

A `<text>` element in the regression text xml which contained only
whitespace would cause the import to crash as this would be ignored by
the XML parser, leading to a `Null` `nodeValue` for that element. To
solve this, we need to:

1. Use `xml:space="preserve"` attribute on `<text>` elements
2. Update the DTD to allow `xml:space` on `<text>` elements
3. While we are at it, move the DTD from `www.tavultesoft.com` to
   `api.keyman.com`.

See also:
* keymanapp/tavultesoft.com#4
* keymanapp/api.keyman.com#155
2021-06-03 10:07:31 +10:00
Marc Durdin
52dcd313bf fix(developer): TframeTextEditor.SetText was not synchronous
Fixes #5095.

If the text editor was loaded, `SetText` would not be synchronous
because it executed some Javascript to make the text change, so setting
the text and immediately reading it again would give the old text. This
is what the On Screen Keyboard editor was doing (it would synchronize
the visual editor and text editor at save). This fix updates `SetText`
to update the backing store as well as the front end editor.
2021-05-18 06:33:33 +10:00
Marc Durdin
4739b92daf fix(developer): kmconvert commandline and deploy
A few fixes and improvements:
* kmconvert was missing a command line parameter for `-target` to
  specify the platform targets for a project
* kmconvert should avoid throwing unhandled exceptions, rather if
  sentry is not present then just write to console.
* Include kmconvert and its data files in the deployment of kmcomp.zip,
  which is done on the build agent (just need to make sure files are
  in the right place here.)
* Side fix: also made sure kmcomp would emit the exception message to
  console if sentry is not present.
2021-05-14 11:00:20 +10:00
Marc Durdin
5bbee38e0c
Merge pull request #4935 from keymanapp/fix/developer/cherry-pick/4803-chiral-warning-is-disruptive
fix(developer): chiral mismatch warning is disruptive 🍒
2021-04-21 11:27:16 +10:00
Marc Durdin
97cdc708fa fix(developer): chiral mismatch warning is disruptive
Fixes #4803.

This fixes part of #4803 - namely the obtrusive warning flagging that
there are mismatched modifier types in the keyboard. Instead of making
the change during tab switching, it simply shows a warning message in
the design view of the keyboard, which the developer can choose to
ignore.

This does not address the removal of comments or the switch of character
formats which is part of that conversion routine. That is a more complex
change to the parser.
2021-04-21 10:12:27 +10:00
Marc Durdin
63c25cf93f fix(developer): avoid crash if .kpj.user file is malformed
Fixes #4917.

This updates `TProjectLoader` to use the same exception handling pattern
for loading the .kpj.user file as we use for the .kpj file.
2021-04-20 10:52:59 +10:00
Marc Durdin
08235c869e
Merge pull request #4832 from keymanapp/fix/developer/4830-range-expansions-buffer-size-cherry
fix(developer): buffer size for range expansions 🍒
2021-04-01 12:49:54 +11:00
Marc Durdin
14198c7a81 fix(developer): buffer size for range expansions
Fixes #4830.

There remain some additional buffer size checks we should be doing in
`GetXString` but this will address the current issue by using the
standard maximum buffer size.
2021-03-31 19:12:33 +11:00
Marc Durdin
573273a86a fix(developer): requote font names
Fixes #4810.
2021-03-29 20:53:56 +11:00
Marc Durdin
5eb0aec0e8
Merge pull request #4691 from keymanapp/fix/developer/named-code-constants-end-of-line-test
fix(developer): support named character codes at end of line
2021-03-16 23:26:03 +11:00
Marc Durdin
9ae541940a
Merge pull request #4699 from keymanapp/fix/developer/validate-keyboard_info-bcp47-canonicalisation-info
chore(developer): upgrade bcp 47 canonicalisation to warning
2021-03-16 23:25:28 +11:00
Marc Durdin
de74fddbc2 chore(developer): upgrade bcp 47 canonicalisation to warning
This does not trigger a build failure; validation warnings currently always pass.
Info messages are currently suppressed with -s which also suppresses the banner,
which is more plumbing than we should change just now.
2021-03-16 20:07:27 +11:00
Marc Durdin
aa8538a8d9
Merge pull request #4689 from keymanapp/fix/developer/validate-keyboard_info-bcp47-canonicalisation-info
fix(developer): validate keyboard_info should give info on non-canonical bcp47
2021-03-16 19:32:36 +11:00
Marc Durdin
12184f1857 fix(developer): support named character codes at end of line
If a named character code was followed by a `\n`, it would not be
recognised.
2021-03-16 13:49:55 +11:00
Marc Durdin
4f958985a0 fix(developer): &CasedKeys and &MnemonicLayout are not compatible together
The test for `&mnemoniclayout` was incorrectly failing to check the
actual state of `&casedkeys`, which broke all mnemonic layouts.
2021-03-16 13:46:34 +11:00
Marc Durdin
4c82c2b545 fix(developer): validate keyboard_info should give info on non-canonical bcp47 2021-03-16 13:44:23 +11:00
Marc Durdin
523cf39d10 chore(developer): add B11 ISO code for ABNT2 keyboard 2021-03-12 11:11:42 +11:00
Marc Durdin
c10b010d59 fix(developer): Expand filenames before load
Fixes #4583.
2021-03-05 13:44:55 +11:00
Marc Durdin
690a7fd787
Merge pull request #4586 from keymanapp/feat/developer/2241-caps-controlled-keys
feat(developer): &CasedKeys system store
2021-03-05 11:41:16 +11:00
Marc Durdin
103e46c0d5
Merge pull request #4584 from keymanapp/feat/developer/2241-expansions
feat(developer): Range expansions
2021-03-04 15:05:32 +11:00
Marc Durdin
b7765483ec
Merge pull request #4576 from keymanapp/feat/developer/4314-open-containing-folder-options
feat(developer): Add different Open Containing Folder buttons
2021-03-04 15:05:19 +11:00
Marc Durdin
d536345a20
Merge pull request #4574 from keymanapp/fix/developer/2789-support-all-fonts-keyboard-fonts-dialog
fix(developer): Support all fonts in Keyboard Fonts dialog
2021-03-04 15:05:10 +11:00
Marc Durdin
0cbd053cda
Merge pull request #4571 from keymanapp/fix/developer/4278-improve-cef-location-search-stability
fix(developer): improve CEF location search stability
2021-03-04 15:05:02 +11:00
Marc Durdin
e9e4e7bcb6 feat(developer): &CasedKeys system store
Fixes #2241.

The `&CasedKeys` system store is a compiler feature that reduces the
repetitive nature of keyboard rules for `CAPS` and `NCAPS`. The
`&CasedKeys` system store defines a list of virtual keys for which
'normal' Caps Lock rules apply. This store has no default value, for
backward compatibility.

Once this store is defined, then you can define just the unshifted and
shifted versions of a rule, and Keyman Developer will synthesize the
`CAPS` and `NCAPS` versions of the rule. For example, you may have the
following rules:

```
store(&CasedKeys) [K_A]
+ [K_A] > 'α'
+ [SHIFT K_A] > 'Α'
```

These would be replaced by the compiler with:

```
store(&CasedKeys) [K_A]
+ [NCAPS K_A] > 'α'
+ [SHIFT CAPS K_A] > 'α'
+ [CAPS K_A] > 'Α'
+ [SHIFT NCAPS K_A] > 'Α'
```

You can also use this functionality with characters in the key part of
the rule:

```
store(&CasedKeys) 'a'..'c'
+ 'a' > 'α'
+ 'A' > 'Α'
```

and the compiled expansion would be similar:

```
store(&CasedKeys) [K_A] [K_B] [K_C]
+ [NCAPS K_A] > 'α'
+ [SHIFT CAPS K_A] > 'α'
+ [CAPS K_A] > 'Α'
+ [SHIFT NCAPS K_A] > 'Α'
```

This feature is backwardly compatible with Keyman 6.0, as it is entirely
implemented in the compiler.

This feature is not compatible with mnemonic layouts, and the keys
defined in the `&CasedKeys` store must be the unshifted base keys as
found on a US English keyboard, or you can use ISO9995 identifiers if
you prefer.

If you define a rule where you specify either `NCAPS` or `CAPS`, for a
key found in the store, then no change will be made to that rule. You
can also continue to define rules which use `NCAPS` or `CAPS` for keys
not found in the store.

As a side-benefit, this allows the visual designer to be used and
support Caps Lock, although at this stage, the `&CasedKeys` store is not
surfaced in the visual designer.
2021-03-04 13:41:04 +11:00
Marc Durdin
fe5de67c1f feat(developer): Range expansions
Relates to #2241.

Range expansions are a new language feature that reduce verbosity in
Keyman Keyboard Language (.kmn) files by making it possible to collapse
sequential ranges with a new `..` operator. It is envisioned that these
will be used primarily in stores.

Two kinds of expansions are available: character ranges, and virtual key
ranges.

The syntax is:

```
char '..' char
vkey '..' vkey
```

Where the `char` terminator is a single normal character, and the `vkey`
terminator is a single virtual key. `outs` is permissible for
terminators but no other statement is allowed. Whitespace is per normal
Keyman keyboard language syntax.

Character ranges will replace the range with the set of characters
between the terminators, based on the Unicode value of the terminators.

Examples:

```
store(alphabet) 'a' .. 'z'
store(alpha_not_bq) 'ac'..'pr'..'z'
store(capitals) U+0041 .. U+005A
```

Virtual key ranges work in a similar fashion, but with virtual keys. The
starting and terminating virtual key must have the same shift state.
This will be most useful for character and numeric virtual keys, as the
ranges are based on the numeric value of the virtual key as defined by
Windows, not its position on the keyboard.

Examples:

```
store(alphakeys) [K_A] .. [K_Z]
store(numkeys) [K_0] .. [K_9]
```

Ranges must be positive, that is, you cannot use `'z' .. 'a'`.

While this expansion is not expected to be very useful in rules, it is
still permitted. `context()` and other offsets are calculated on the
expanded form, not the collapsed form. Similarly, `any()`/`index()`
offsets are calculated on the expanded form.

'a' .. 'z' > context(3)  c this produces 'c', not 'z'

Because ranges are expanded at compile time, ranges that are overly
long will result in an error, so you cannot use, for example:

```
store(AllUnicode) U+0020 .. U+10FFFF
```

The precise maximum length of a range is dependent on the context where
it is used.

The changes are entirely compiler-based; no change is made to the .kmx
file format or to the Keyman apps.
2021-03-04 09:43:30 +11:00
Marc Durdin
c595767e39 feat(developer): Add different Open Containing Folder buttons
Fixes #4314.

Adds 'Open Source Folder', 'Open Build Folder', and
'Open Project Folder' actions to various parts of Keyman Developer.
2021-03-03 15:36:11 +11:00
Marc Durdin
49f05e879d fix(developer): Support all fonts in Keyboard Fonts dialog
Fixes #2789.

The Keyboard Fonts dialog skipped some fonts which it did not recognise
as valid TrueType fonts. As a bonus, I've rewritten a few parts of it to
make it significantly faster to load.

I also turned off the font formatting for the list, as it was not very
helpful and hurt performance considerably.
2021-03-03 14:24:59 +11:00
Marc Durdin
6180b01a31
Merge pull request #4562 from keymanapp/fix/developer/3337-track-modified-state-wordlist-editor
fix(developer): track modified state in wordlist editor better
2021-03-03 10:48:21 +11:00
Marc Durdin
726e93bcc3
Merge pull request #4559 from keymanapp/feat/developer/2556-isRTL-support-for-lexical-models
feat(developer): isRTL support for lexical model editor
2021-03-03 10:47:34 +11:00
Marc Durdin
290d21f4c6 chore(developer): address review feedback 2021-03-03 10:45:52 +11:00
Marc Durdin
9ffc378fef chore(developer): fixup wxs path 2021-03-03 10:42:35 +11:00
Marc Durdin
2e61cb8e32 fix(developer): improve CEF location search stability
Fixes #4278.

When Keyman Developer is installed without Keyman for Windows, the
program silently crashes, because it is looking for libcef.dll in the
Keyman Desktop install folder rather than using its own copy of it.

This improves the search for libcef.dll and kmbrowserhost.exe, and
includes kmbrowserhost.exe with the Keyman Developer installation.

In the future, we could consider moving kmbrowserhost.exe into a common
folder (perhaps when we split Keyman for Windows and Keyman Developer
projects in 15.0).

I threw in a one-liner addressing a deprecated function warning in the
Developer build.
2021-03-03 10:05:04 +11:00
Marc Durdin
e4d09ece72
Merge pull request #4564 from keymanapp/fix/developer/3011-osk-import-avoid-blank-keys
fix(developer): Avoid blank keys when importing KMX to KVKS
2021-03-03 09:28:29 +11:00
Marc Durdin
a0734f153b
Merge pull request #4552 from keymanapp/fix/developer/2740-touch-editor-importing-osk-right-alt-layer
fix(developer): touch layout osk import handling of multiple modifiers
2021-03-03 09:27:11 +11:00
Marc Durdin
84c0202d85 chore(developer): tweak casing 2021-03-02 13:27:17 +11:00
Marc Durdin
85b9e04345 chore(developer): address review comment 2021-03-02 13:26:40 +11:00
Marc Durdin
36f5788651 fix(developer): Avoid blank keys when importing KMX to KVKS
Fixes #3011.

Keys that have only whitespace will no longer generate separate key data
for the on screen keyboard, as they have no visual presentation anyway.
2021-03-02 12:16:09 +11:00
Marc Durdin
7ea7ba0e11 fix(developer): track modified state in wordlist editor better
Fixes #3337.

In some situations, the wordlist editor was not tracking modified state
100% correctly, which meant that edits could be lost. This resolves that
by simplifying the modification state tracking.
2021-03-02 09:27:18 +11:00
Marc Durdin
eb713ec274 feat(developer): isRTL support for lexical model editor
Fixes #2556.

This adds support for `isRTL`, `insertAfterWord`, and
`quotesForKeepSuggestions` punctuation options for lexical models, both
in the parsing and in the user interface. A number of options are
presented to the user for the quotes and word breaking characters.

The parser continues to be a regex-based typescriptish parser. Expect it
to be gross. It's too big a job to do properly right now, so it is
somewhat limited and will bail if it finds structures it can't
understand.

I would hope to use something a bit smarter in the future to interface
with the editor. Probably when we are actually fully web-based and can
depend on a Typescript compiler directly.

Please don't get mad at me! 😟😟😟
2021-03-01 21:46:51 +11:00
Marc Durdin
1fcfefa3cf fix(developer): support for smp names 2021-03-01 16:05:17 +11:00
Marc Durdin
3f54c81461 fix(developer): touch layout osk import handling of multiple modifiers
Fixes #2740.

The definitions for several of the combined modifiers was incorrect,
which led to a mismatch when attempting to import those layers from a
visual keyboard into the touch layout editor.
2021-03-01 15:44:55 +11:00
Marc Durdin
26b1d777f7 fix(developer): Improve stability of named code constants
Fixes #4423.

Using a named character constant with a store name that included
characters outside ascii could cause kmcmpdll to crash with an assertion
failure.

This fix allows store names defined in the .kmn file to use characters
outside ascii.

Note that more work needs to be done on which characters are acceptable
to use, as this is somewhat implementation-specific according to the C++
specification for `iswalpha`.

Added a test case to verify various named code constant examples.

Also removes dead code for `IsCJKUnifiedIdeograph` as this was never
used and somewhat pointless in any case.

NamedCodeConstants.cpp could stand to be rewritten using `std::map` or
equivalent. Current implementation is pretty icky.
2021-03-01 10:25:06 +11:00
Marc Durdin
c966f297cb
Merge branch 'beta' into feat/developer/improve-bcp47-canonicalization 2021-02-09 07:03:28 +11:00
Marc Durdin
7a59d073ff chore(windows): address review comments, add test 2021-02-09 06:56:43 +11:00
Marc Durdin
9b0daf5652
Merge pull request #4410 from keymanapp/fix/developer/4280-if-nul-start-of-context
fix(developer): Compiler check for if and nul at start of context
2021-02-09 06:47:14 +11:00
Marc Durdin
3a4038a74e
Merge pull request #4408 from keymanapp/fix/developer/4250-debug-information-with-unicode-identifiers
fix(developer): debug information with unicode identifiers
2021-02-09 06:45:58 +11:00