Commit graph

889 commits

Author SHA1 Message Date
Keyman Server
7ad056bf5f
Merge branch 'epic/embed-osk-in-kmx' into auto/A19S16-merge-master-into-embed-osk-in-kmx 2025-11-20 11:08:48 +01:00
Marc Durdin
edca16f508 change(windows): include map2pdb generation for relevant Delphi projects
Adds a call to map2pdb for Delphi projects, if map2pdb is an executable
on the path. This way, we get .pdb files we can use for debugging and
for performance profiling. This also replaces tds2dbg.

If map2dbg is available, then the build and install actions will copy
the PDB to be alongside the corresponding executable, making most debug
actions relatively seamless for finding symbols.

Also fixes up setup.exe in Windows and Developer to extend setup.exe to
a 512-byte boundary after map2pdb patches the PE.

Relates-to: #14787
Build-bot: skip release:developer,windows
Test-bot: skip
2025-11-13 14:48:18 +01:00
Marc Durdin
54642dc86d fix(windows): disable OutputDebugString from DllMain
Following investigation, it seems that OutputDebugString can trigger a
loader lock as it throws an exception which can be handled by a global
exception handler, which may try and load/unload DLLs or perform other
unsafe tasks (e.g. StackWalk). The safest solution is to remove the
debug string logging altogether from code paths that run from DllMain.

It would be nice to further simplify DllMain but that would be a
significant amount of additional work.
2025-11-13 14:47:39 +01:00
Marc Durdin
21c3a630bf chore(windows): upgrade VC++ projects to v143 (VS2022)
Test-bot: skip
Build-bot: skip release:developer,windows
2025-10-31 13:33:30 +01:00
Marc Durdin
9e1fe8e6de chore(windows): upgrade VC++ projects to v143 (VS2022)
Test-bot: skip
Build-bot: skip release:developer,windows
2025-10-30 16:31:45 +01:00
Keyman Server
87420e15c1
Merge branch 'epic/embed-osk-in-kmx' into chore/A19S14-merge-master-into-embed-osk-in-kmx 2025-10-24 11:14:03 +02:00
Marc Durdin
4d436e4bcf
Update mcompile.h
Build-bot: skip
2025-10-13 14:20:59 +02:00
Marc Durdin
03cd865c09
Apply suggestions from code review
Co-authored-by: rc-swag <58423624+rc-swag@users.noreply.github.com>
2025-10-13 10:37:35 +02:00
Marc Durdin
c99e0c01c4 chore(windows): address warnings 2025-10-08 15:08:04 +02:00
Marc Durdin
50ffbb2722 fix(windows): osk: handle simulated left Control event when AltGr pressed
When a European layout is active, and the user presses AltGr, Windows
generates a simulated VK_LCONTROL event alongside the VK_RMENU event.
This was causing the OSK to show LCtrl as depressed alongside RAlt, so
the OSK would show the wrong modifier layer, which was unhelpful and
confusing to the end user.

It is possible to detect the simulated VK_LCONTROL in the WH_KEYBOARD_LL
hook, because the scan code generated is 0x21D, instead of 0x1D.
Warning: this is not a documented value. (But, this 0x21D scan code is
not passed to the WM_KEYDOWN event!) Therefore, we use Keyman's existing
kmnLowLevelKeyboardProc to pass modifier key events on to the visual
keyboard.

This patch handles only this specific scenario, by watching for that
specific scan code in the new handler in the UfrmOSKOnScreenKeyboard
module, together with some minor refactoring so that it fits neatly.

A future improvement would be to have all modifier key processing go
through this new handler, and eliminate the timer-based polling of the
keyboard. However, there is some additional risk around missing events,
leading to 'stuck modifiers'.

Fixes: #14890
Build-bot: skip release:windows
2025-10-08 14:32:40 +02:00
Marc Durdin
31c8f09155 refactor(windows): consolidate mc_kmxfile.h
Use legacy_kmx_memory.h instead of mc_kmxfile.h for mcompile. Removing
the unused 'hbitmap' and replacing with the binary file dword data.

Test-bot: skip
2025-09-30 14:35:02 +02:00
Marc Durdin
3be434aa65 refactor(windows): consolidate legacy_kmx_file.h into kmx_file.h
These two files were largely the same, with legacy_kmx_file.h trailing
kmx_file.h in features. The primary difference was that
legacy_kmx_file.h still had Windows-specific types, but the types in
km_types.h made this a drop-in replacement.

Test-bot: skip
2025-09-30 14:13:11 +02:00
Marc Durdin
ad9ab53c72 feat(windows): improve startup time by caching locale names
This was flagged years ago as a potential performance hotspot: each
locale is loaded at process start for any kmcomapi-involved process,
which takes quite a long time. This refactor moves the locale
enumeration out of kmcomapi and into the build process, so we have a
static list of locales put into locale/index.xml.

This includes a minor breaking change to Keyman Engine API on Windows:
`MessageFromID(id, locale)` now only allows the three ids
SKUILanguageName, SKUILanguageNameWithEnglish, and SKLanguageCode, for
performance reasons. At this point, only SKUILanguageNameWithEnglish is
actually used anywhere in Keyman, and it is unlikely that any other
consumers are requesting alternate IDs.

Fixes: #14787
Build-bot: skip release:windows
2025-09-19 14:11:37 +02:00
Marc Durdin
f394245636 maint(common): consolidate builder scripts
Clarifies the confusing builder.inc.sh / build-utils.sh distinction by
giving the scripts more appropriate names. Most build scripts should use
builder-full.inc.sh; some helper scripts can use builder-basic.inc.sh.
Documented in resources/build/README.md.

Renames:
* resources/build/builder.inc.sh to resources/build/builder-full.inc.sh
* resources/build/build-utils.sh to resources/build/builder-basic.inc.sh

Other changes:
* Moves Android-specific functions out of builder-basic.inc.sh and into
  android/build.sh.
* Renames functions in builder-basic.inc.sh

More functions may be moved from builder-basic.inc.sh into utils.inc.sh
or other scripts in the future.

Fixes: #14065
Build-bot: build all
Test-bot: skip
2025-08-02 08:11:24 +10:00
Marc Durdin
65158a0526 maint(common): rename shellHelperFunctions.sh to utils.inc.sh
Adds documentation for various functions, removes unused functions (a
couple of simple, very lightly used functions were unDRYed; these could
go back the other way across all shell scripts if necessary). TODO items
noted for follow-up refactoring.

Fixes: #14275
Relates-to: #14269
Build-bot: build all
Test-bot: skip
2025-08-02 06:58:40 +10:00
rc-swag
ad962172e9 fix(windows): remove dead code 2025-07-28 16:54:37 +10:00
rc-swag
f38145eaa2
Merge branch 'master' into fix/windows/14342/invalid-data-type-for-regkey 2025-07-25 10:58:55 +10:00
rc-swag
3c311a5aaa fix(windows): free the correct object KeyboardToggleReg 2025-07-24 16:59:41 +10:00
Eberhard Beilharz
e4c1867583
maint(windows): remove another (unused) include of win/zip.inc.sh
Addresses code review comment.
2025-07-21 10:26:32 +02:00
rc-swag
314c606aec fix(windows): add check a fix for registry datatypes
Fixes: #14342
The Windows system level keyboard hotkeys controlled in
registry have sometimes been incorrectly written as
a DWORD datatype. There 106 events in sentry for just
July. When opening the Windows setting dialog and the registry
has DWORDS it will show unassinged in the dialog if apply
is pressed it will convert the keys to REG_SZ.
This fix follows a similar pattern it will check the data
type of the registry key if it is DWORD it will remove it
and add a new key of the same name as REG_SZ and set it to
the unassigned value.

Fixes: KEYMAN-WINDOWS-4NK
2025-07-15 16:27:14 +10:00
rc-swag
6345a0b9b3
fix(windows): review comment
Co-authored-by: Eberhard Beilharz <ermshiperete@users.noreply.github.com>
2025-07-01 15:13:02 +10:00
rc-swag
82649634e5 chore(windows): Merge branch 'master' into feat/windows/13918/human-readble-msg-413-err 2025-06-27 14:54:04 +10:00
Marc Durdin
156bdcdd8a maint(common): rename and move builder_if_release_build_level 2025-06-16 06:45:42 +10:00
Marc Durdin
f3136d5ab2 maint(developer): skip signature check on buildLevel build 2025-06-16 05:54:33 +10:00
Marc Durdin
870d37f56b maint(developer): only copy .dbg/.pdb on release buildLevel 2025-06-16 05:40:30 +10:00
rc-swag
7ad4ba8527 feat(windows): Fix error checking order 2025-06-06 15:54:32 +10:00
rc-swag
770506c331 feat(windows): tweak diagnositc error message 2025-06-06 11:14:26 +10:00
rc-swag
0de78e808f feat(windows): don't send logs with diagnostics 2025-06-06 10:29:14 +10:00
rc-swag
5afaf7cbaf feat(windows): human text message for 413 error 2025-05-27 20:54:58 +10:00
Eberhard Beilharz
4d81589f48
maint(common): use unique names for Keyman version variables
Previously the builder scripts defined a readonly `VERSION` environment
variable for the Keyman version. That caused problems when another
(external) script tried to define a `VERSION` variable. We encountered
this problem when trying to move the TC build steps of a configuration
into a single script (#13399) when we tried to source `~/.nvm/nvm.sh`.

This change uses a Keyman specific prefix for the version variables and
renames `VERSION` → `KEYMAN_VERSION` etc. Unfortunately these variables
are used in a lot of places, so this turned out to be a bit of a yak
shave.

Test-bot: skip
2025-05-07 18:46:51 +02:00
rc-swag
b2463be19a fix(windows): review comments 2025-03-28 10:36:46 +10:00
rc-swag
79b15dfeb4 fix(windows): move thread check guard
Removed the redundant thread check guard on load modifer. Added guard
to reading the option. Also fixed some formating. and made the load
modifier private.
2025-03-27 16:05:28 +10:00
rc-swag
e3f2e85945 fix(windows): reload right modifier key option
Fixes: #13440

This refactors the cached of the right modifier key used in hotkeys
option. In the lowlevelhook you couldn't reset the cached value.
It is now part of the hotkeys class which is more logical encapsulation
the logic assocaited with the hotkeys.
2025-03-27 13:30:05 +10:00
rc-swag
d1a371d693
Merge pull request #13421 from keymanapp/fix/windows/13176/remove-online-update-deadcode
fix(windows): remove online update deadcode
2025-03-06 15:30:43 +10:00
rc-swag
e56f6b908c
Merge pull request #13413 from keymanapp/fix/windows/13216/checkforupdates-reg-one-location
fix(windows): Check for updates registry value stored under the one Key
2025-03-06 15:29:17 +10:00
rc-swag
5dd36e4aad
fix(windows): review comments
Co-authored-by: Darcy Wong <darcy_wong@sil.org>
2025-03-06 12:01:06 +10:00
rc-swag
489ef98c47 fix(windows): onlineupdate icon deadcode removed
Fixes:#13176
2025-03-05 16:28:22 +10:00
rc-swag
bbbce44f3c fix(windows): add comments re default values 2025-03-05 10:39:49 +10:00
rc-swag
5855b8b3f2
Merge pull request #13215 from keymanapp/fix/windows/12660/preserve-report-usage
fix(windows): Check registry report usage value in setup process
2025-03-05 10:03:13 +10:00
rc-swag
80be1e9434 fix(windows): checkforupdates in keyman engine key
The SRegValue_CheckForUpdates was written my utilkeymanoptions
to the Keyman Engine Key but read from Keyman Desktop Key.
This change moves it to only be read in Keyman Engine Key.
It also move the last update time to this Key for completness

Fixes: #13216
2025-03-04 21:09:09 +10:00
rc-swag
c99bf7b508 fix(windows): whitespace fix 2025-03-04 15:45:30 +10:00
rc-swag
95f748888a fix(windows): sets options values in firstrun
Previously it only set the startwithwindows, checkforupdats and
autmaticallyreportusage values in firstrun if the flag was true.
It was only true if the argument was passed to the install executable on
the command line. However, it is valid to treat its non existance on the
command line as false for these 3 values.
2025-03-04 14:45:24 +10:00
Marc Durdin
d83454ab77 chore(windows): ensure dependencies for keyman32 exclude core:wasm
Fixes: #13374
2025-02-28 17:52:27 +01:00
Marc Durdin
f9ab3c7045
Apply suggestions from code review
Co-authored-by: Darcy Wong <darcy_wong@sil.org>
2025-02-24 09:58:48 +01:00
Marc Durdin
ef60c08d7c chore: add build.sh edit action for Delphi projects
This opens up the Delphi IDE with the correct KEYMAN_ROOT environment,
which allows for debugging. This is very helpful when working with
multiple worktrees, and also helps to avoid editing a project in the
wrong tree.
2025-02-22 06:18:47 +01:00
rc-swag
ba22be570e fix(windows): automaticaly report usage defualt false in options
The process is quite confusing. The options from the setup install
options will only resualt in a command line option being past through
to firstrun if it is true. If is false the options will not be passed
through. Therefore if this is the first installation once when the
Keyman Configuration is opened it will show the default option
configured in utilkeymanoptions.pas, in kmcomapi. This result of all
this was a user would deselect the option in setup. When they opened
configuration it was set to true.
2025-02-17 15:59:15 +10:00
rc-swag
96b3c4f983
feat(windows): review suggestions
Co-authored-by: Marc Durdin <marc@durdin.net>
2025-02-10 15:00:17 +10:00
rc-swag
b074c2c0ef feat(windows): add release ownership rename mutex owned
Add a ReleaseOwnership member to TKeymanMutex.
Rename MutexOwned to TakeOwnership.

Fixes: #13167
2025-02-10 13:50:18 +10:00
rc-swag
9eec271011 feat(windows): check updates and automatic update merged
Check updates meaning has slightly changed it is now automatic updates
and it will now check, download and when possible start the install.

Previously it just meant a check for upates was made and notified
the user of updates.

Fixes:#13114
2025-02-03 14:25:44 +10:00
rc-swag
53daacd6e7
Merge pull request #12995 from keymanapp/feat/windows/12994/add-boot-switch
feat(windows): add boot switch
2025-01-31 12:09:25 +10:00