Commit graph

1008 commits

Author SHA1 Message Date
Marc Durdin
d496f8d59b
Merge pull request #16443 from keymanapp/maint/windows/16433-remove-koSwitchLanguageForAllApplications-and-cleanup
maint(windows): remove `koSwitchLanguageForAllApplications`, `koAutoSwitchOSKPages`, osVista, osWin7, osWin8, cleanup
2026-09-01 16:11:29 +07:00
Marc Durdin
947dbe9910
Merge pull request #16439 from keymanapp/refactor/windows/15333-cleanup
refactor(windows): cleanup unused wm_keyman_control values
2026-09-01 16:11:18 +07:00
Marc Durdin
3c44f8ab5b
Merge branch 'master' into fix/windows/15333-simplify-keyboard-refresh 2026-09-01 15:44:05 +07:00
Marc Durdin
33e64f1edd refactor(windows): rename GetCapsAndNumlockState() to RefreshModifierState()
Fixes: #16434
Test-bot: skip
2026-08-27 08:20:21 +02:00
Marc Durdin
e7bc51fcda chore(windows): formatting
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
Co-authored-by: Ross Cruickshank <rc-swag@users.noreply.github.com>
2026-08-27 07:53:40 +02:00
Marc Durdin
0f281a6a9d maint(windows): remove koSwitchLanguageForAllApplications, koAutoSwitchOSKPages, osVista, osWin7, osWin8, cleanup
* Remove references to `koSwitchLanguageForAllApplications` and
  `koAutoSwitchOSKPages` options, translated strings for them, and
  related `GlobalKeyboardChangeManager` -- no longer required since
  Win8.
* Remove Windows Vista-, 7-, and 8-specific code paths - except for the
  one user-facing setting for installing keyboards on downlevel
  operating systems.
* Remove commented code

Fixes: #16433
Test-bot: skip
2026-08-27 07:47:25 +02:00
Marc Durdin
2c7bba8d10 refactor(windows): cleanup unused wm_keyman_control values
Cleanup of unused `wm_keyman_control` and `wm_keyman_refresh` values,
and some other unused messages, which were making the implementation
harder to understand.

Relates-to: #15333
Follows: #16435
2026-08-26 10:18:00 +02:00
Marc Durdin
0e332b6f6c fix(windows): simplify keyboard refresh and make it more on-demand
Some checks are pending
Keyman Build Summary / Summarize build status checks (push) Waiting to run
Clean up the keyboard refresh process. Keyman COM API will post a
`wm_keyman_refresh`, `KR_REQUEST_REFRESH` message when changes have been
made to the list of installed keyboards (or some other keyboard-related
settings change).

Keyman Engine (any arch) will handle this message, in any process, and
post a message to the master controller (keyman.exe, TfrmKeyman7Main),
`wm_keyman_refresh`, `KR_PRE_REFRESH`.

Keyman Engine (keyman32) will handle _this_ message in the master
controller thread context, and increment the global refresh tag. It also
asks the other architecture host process(es) to update their global
refresh counter to the same value (by posting `wm_keyman_refresh`,
`KM_PRE_REFRESH` to those process(es).)

This refresh tag is then compared on-demand in each thread to the
thread's current refresh tag value, when a keyboard activation is
received, on set focus, or on a keystroke, and the keyboard list is
refreshed at that point.

This means that keyboard installation no longer triggers a large amount
of activity reloading all the keyboards on all windowed threads, but
rather they will gradually reload as the user interacts with them. It
also fixes #15333, which related to having threads with only child
windows -- that is, that were parented by top-level windows from other
threads -- which thus never received the global broadcast in the earlier
design. For example, VSCode, Notepad in Win11, Chrome.

Fixes: #15333
2026-08-26 10:15:46 +02:00
Matthew Lee
446559c221
Update windows/src/engine/keyman32/capsstate.cpp
Co-authored-by: rc-swag <58423624+rc-swag@users.noreply.github.com>
2026-08-24 09:19:47 -04:00
Matthew Lee
fb91d2fc75
Update windows/src/engine/keyman32/capsstate.cpp
Co-authored-by: Marc Durdin <marc@durdin.net>
2026-08-22 10:26:53 +03:00
Matthew Lee
dcbfcf810f
Update windows/src/engine/keyman32/capsstate.cpp
Co-authored-by: Marc Durdin <marc@durdin.net>
2026-08-22 10:26:23 +03:00
Matthew Lee
13326b4091
Update windows/src/engine/keyman32/capsstate.cpp
Co-authored-by: Marc Durdin <marc@durdin.net>
2026-08-22 10:25:46 +03:00
Matthew Lee
f586e94cf5
Update windows/src/engine/keyman32/appint/aiTIP.cpp
Co-authored-by: Marc Durdin <marc@durdin.net>
2026-08-22 10:25:22 +03:00
Matthew Lee
5d073fa44f fix(windows): resync caps lock state when Keyman keyboard is activated
The Caps Lock and Num Lock flags in Globals::ShiftState() are updated
only as key events pass through the engine, so they go stale when the
toggle is changed while a non-Keyman layout is active. The existing
resync in GetCapsAndNumlockState() runs on window focus change, which a
keyboard switch does not trigger, so the core processor was told Caps
Lock was off until the user toggled it twice.

Extract the toggle resync as RefreshToggleState() and call it from
TIPActivateKeyboard(), which is the profile activation path for both
Win+Space and the Windows language selector.

Fixes #16422

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011GdFpFi5eqJP6C1YjuQytY
2026-08-21 23:21:34 +03:00
Marc Durdin
adaf2337c5
Merge pull request #12191 from keymanapp/epic/kmc-convert
epic: kmc-convert 😎
2026-08-20 16:14:11 +07:00
Marc Durdin
f498400b86
Merge pull request #16363 from keymanapp/fix/windows/12812-handle-invalid-font-files-in-package-install
fix(windows): handle font and package .zip format errors during package installation
2026-08-19 13:53:28 +07:00
Marc Durdin
3a4803c359
Merge pull request #16362 from keymanapp/fix/windows/12905-support-png-icon-in-tray
fix(windows): support .png format icon in tray icon
2026-08-19 13:53:04 +07:00
SabineSIL
882ede0c54
feat(developer): kmc-convert: new conversion .keylayout->kmn 😎 (#12564)
kmc-convert provides tooling to convert between various common keyboard
description file formats. Each conversion will be implemented in its
single, separate module (and each module will done in its own PR)

This PR will address the conversion **keylayout → kmn**

Co-authored-by: Marc Durdin <marc@durdin.net>
2026-08-18 15:16:02 +02:00
Marc Durdin
4a378252b0 fix(windows): improve icon resource management and avoid double-destroy
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
Copy the handle of the icon from kmcomapi rather than assigning, so that
we do not end up calling DestroyIcon twice on the same handle (once by
FTrayIcon destruction, and once by kmcomapi).

Co-authored-by: Ross Cruickshank <rc-swag@users.noreply.github.com>
2026-08-18 08:01:12 +02:00
Marc Durdin
9f8717e4f8
Merge pull request #16361 from keymanapp/fix/windows/12611-release-shift-on-osk-with-right-shift
fix(windows): release shift key on OSK when user releases physical right shift
2026-08-14 11:30:39 +02:00
Marc Durdin
aff7665c07 refactor(windows): remove one use of with in kpinstallfont
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
Co-authored-by: Ross Cruickshank <rc-swag@users.noreply.github.com>
2026-08-14 07:57:57 +02:00
Marc Durdin
16559f9a31 docs(windows): update comment for TfrmOSKOnScreenKeyboard.OskModifierEvent 2026-08-14 07:54:20 +02:00
Marc Durdin
e18df382f5 fix(windows): handle font and package .zip format errors during package installation
Quietly handle invalid font files while installing, and cleanly abort
install of broken packages. Report the errors to Sentry but do not
crash.

Fixes: #12812
Fixes: KEYMAN-WINDOWS-45K
Fixes: KEYMAN-WINDOWS-6S8
Fixes: KEYMAN-WINDOWS-430
Fixes: KEYMAN-WINDOWS-7T3
Fixes: KEYMAN-WINDOWS-7SY
Fixes: KEYMAN-WINDOWS-42Z
2026-08-13 14:42:50 +02:00
Marc Durdin
5d0f6f50db fix(windows): ignore invalid keyboard icons in kmcomapi
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
2026-08-13 14:41:50 +02:00
Marc Durdin
d7c88b6bae fix(windows): support .png format icon in tray icon
Fixes: KEYMAN-WINDOWS-3CT
Fixes: #12905
2026-08-13 11:34:46 +02:00
Marc Durdin
2e7772b87c fix(windows): release shift key on OSK when user releases physical right shift
When the user clicks either Shift key on the OSK, that emits a VK_LSHIFT
down key event. If the user subsequently presses and releases the Right
Shift key on their hardware keyboard, that does not reset the isDown
state for the Left Shift key, so the key is not released on the OSK, and
the state becomes inconsistent for apps also.

This change emits a key up event, if when Right Shift is released,
Keyman detects that Left Shift is still "down". Note that if the user
presses and holds Left Shift, and presses and releases Right Shift, the
left shift state will be reset before the users releases Left Shift. But
that's a pathological state!

Fixes: #12611
2026-08-13 10:49:13 +02:00
Sabine
a2bf976e5e chore(common): remove commented old #defines; in some files remove paths for #include km_vkey 2026-08-11 09:46:49 +02:00
Sabine
0b7af5b771 chore(common): include km_vkey.h 2026-08-07 16:00:19 +02:00
Sabine
dde35c87cc chore(common): undo last changes 2026-08-07 12:55:06 +02:00
Sabine
9854206f6a chore(common): use shorter input paths for km_vkey.h and #include also in windows/src/engine/... 2026-08-07 11:59:42 +02:00
Marc Durdin
94723ba556 chore(common): move common cpp files and remove unused files
* Move the following files from common/windows/cpp/include/ to
  common/include/:
  * keymanversion.h
  * vkeys.h

* Move the following file from common/windows/cpp/ to common/cpp/:
  * vkeys.cpp

* Move crc32.cpp,crc32.h into kmcmplib, as they are only used there.

* Remove unused ConvertUTF.c and ConvertUTF.h.

* Update references to the above files.

* Remove precompiled header refs from vkeys.cpp and change data type to
  `char*` for types in vkeys.cpp (unless `USE_CHAR16_T` is defined), so
  that it is more cross-platform accessible, update usages accordingly,
  fixup project definitions accordingly.

* Remove unused define `KMN_KBP_EXPORTING` from kmcmplib/meson.build.

Fixes: #15565
Test-bot: skip
2026-05-20 13:44:05 +02:00
rc-swag
02db51c9b6 fix(windows): address review comments
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
2026-04-28 23:16:17 +10:00
rc-swag
c23284ea51 fix(windows): rename fTestEatenBuf to fOnTestEatenBuf
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
2026-04-02 16:19:45 +10:00
rc-swag
d2012ed79b fix(windows): provide clarity to log message 2026-04-02 13:41:51 +10:00
rc-swag
d7370c472e fix(windows): update lastkey in tip processor
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
Update the lastkey, lastscankey and lasttransition in aaitp.
This ensures that when the pfEaten is FALSE and the get_message_hook
does not recieve the key press the "last" value is correct.
2026-03-31 22:13:45 +10:00
rc-swag
f0cf996976 fix(windows): make log code message fix
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
2026-03-30 13:43:11 +10:00
rc-swag
7084d64b7b fix(windows): clean up debug logs
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
2026-03-26 22:44:47 +10:00
rc-swag
a1c493665e fix(windows): add key transition to better track key press
Some checks are pending
Keyman Build Summary / Summarize build status checks (push) Waiting to run
Added a Key transition member to the thread globals.
This help so better insure we actually matching the key value
that may have been cleared by kmhook_getmessage to the right key.
More importantly makes sure we are not matching it to the wrong
key press. This was happening when a synthazised capslock key press was followed
by and actuall capslock key press.
2026-03-25 15:16:26 +10:00
rc-swag
c1c3952717 fix(windows): reduce the number of places km scan flag
The SCAN_FLAG_KEYMAN_KEY_EVENT was checked in OnKey pressess as well
as an early return option in _KeymanProcessKeystroke. This change
removes the extra and allows _KeymanProcessKeystroke, to be the
central place for code readablitiy and maintainablity.

It also adds a processToggleChange call in kmhook_getmessage as
it is sometimes called before the TIP hook. the call is also idempotent
2026-03-20 09:22:35 +10:00
rc-swag
f4c5d9df02 fix(windows): fix logic error with caps_changed_state
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
Return early if caps lock state is unchanged.
2026-03-16 15:00:12 +10:00
rc-swag
6277735dbb fix(windows): fix typos and grammar in commments 2026-03-16 12:02:26 +10:00
rc-swag
95a7c6008b fix(windows): simplify the processCapsLock if else
Some checks failed
Keyman Build Summary / Summarize build status checks (push) Has been cancelled
also update external processsCaps Lock call to handle the
Updateable change
2026-03-13 14:16:48 +10:00
rc-swag
bc6b0ea773 fix(windows): change caps on updateable
This change also adds a check in aiTIP.cpp to check the
thread data stored last key press and scan code. Before
if the scan code had been cleared then we would process the
synthasized caps lock key presses which was just for the system
and not for the current Keyman app.
2026-03-12 20:20:42 +10:00
Marc Durdin
751fc79014
Merge pull request #14621 from keymanapp/epic/win-arm
epic: ARM support for Windows 🦾
2025-12-22 03:37:22 +01:00
rc-swag
ae979d879f
Merge pull request #15360 from keymanapp/feat/windows/epic-arm-basic-regression-test
feat(windows): epic arm basic regression test 🦾
2025-12-19 10:12:46 +10:00
rc-swag
c3e8d648c7 chore: Merge branch 'master' into chore/merge-master-to-epic-win-arm 2025-12-18 15:45:55 +10:00
rc-swag
c1cd17bc57 feat(windows): fix typo 2025-12-18 14:46:10 +10:00
Marc Durdin
a77518eb28 chore(windows): fix typo in error message
Build-bot: skip
Test-bot: skip
2025-12-17 05:41:20 +11:00
Marc Durdin
1332a9c3f7
Merge pull request #15351 from keymanapp/fix/windows/15345-use-thai-kedmanee-for-ralt-unit-test
chore(windows): correct kbda1 to kbdth0 in comment in unit test
2025-12-16 19:13:07 +01:00
Marc Durdin
484acff8e8
Merge pull request #15353 from keymanapp/maint/win/15065-arm64-core-test
maint(windows): add GitHub Action for ARM64 test for Keyman Core 🦾
2025-12-16 18:49:57 +01:00