Commit graph

61 commits

Author SHA1 Message Date
rc-swag
725bfa7974 fix(windows): bool return value of KeymanIsTextSelected 2024-12-19 13:59:46 +10:00
Marc Durdin
36d00c0424 chore(windows): rename log statements 2024-07-25 10:37:04 +07:00
Marc Durdin
72625fa741
Apply suggestions from code review 2024-07-23 17:40:37 +10:00
Marc Durdin
05edc8a7ce
Merge branch 'master' into refactor/windows/cleanup-engine-logging 2024-07-23 17:29:55 +10:00
rc-swag
eb17115058 fix(windows): add comments for clarity 2024-07-10 10:43:08 +10:00
rc-swag
3998c8b75c fix(windows): make KeymanIsTextSelected Private
Only call GetSelection once, pace the parameters through to the
GetLeftSelection in order to get the results needed for
KeymanIsTextSelected
2024-07-09 22:39:01 +10:00
Marc Durdin
1be73a9c2e refactor(windows): clean up logging
* Remove unused parameters from SendDebugMessage functions
* Add SendDebugEntry and SendDebugExit functions for tracking
  function entry/exit
* Add indenting and function names to log entries
* Remove unused debug functions
* Eliminate now-unused hwnd parameter in initialization functions
* Replace Log,LogEntry,LogExit functions with SendDebug equivalents in
  kmtip

Many functions now have SendDebugEntry/SendDebugExit (or
return_SendDebugExit) pairs. It is important to SendDebugExit on all
returns from a function to keep the log indent depth consistent. In some
cases I chose not to add these logging calls, e.g. on frequently called
functions such as the message hooks.
2024-07-03 21:28:37 +10:00
rc-swag
442903c4f3 fix(windows): add text selected bool emit key when true
Add a bool to the KeymanGetContext call, allowing the windows engine
to make the decistion to emit backspace key stroke when text is
selecting allowing the application to make the correct decision on
how to handle it. Usually deleting the selected text.
2024-06-27 10:58:51 +10:00
Marc Durdin
c06dd480df chore(windows): add new build scripts for Windows builds 2024-05-20 08:27:31 +07:00
Marc Durdin
9f7eff122e chore(windows): remove legacy build Makefiles 2024-05-20 08:16:52 +07:00
rc-swag
477197ae23 chore(windows): missed registryw.cpp deffinition update
Checkin the kmtip registryw.cpp LPCWSTR argument update.
2024-02-12 15:19:43 +10:00
rc-swag
89f6770a78 chore(windows): add const to argument definition
Updated the call stack to keep a const string for the value parameter
being written to registry.

SaveKeyboardOptionCoretoRegistry calls
IntSaveKeyboardOptionCoretoRegistry which calls
RegistryFullAccess::WriteString which calls
RegSetValueExW, which takes a const data parameter.
2024-02-09 11:11:27 +10:00
Marc Durdin
810ed35a8a fix(windows): support unicode strings properly in logs
Fixes #10604.

Note: does not address limitations in etl2log yet, but allows us to emit
unicode strings to the logs.
2024-02-06 14:12:41 +07:00
Ross
1f3e8f768d chore(windows): remove RefreshPreservedKeys pt2 2023-05-11 14:57:01 +10:00
Marc Durdin
3632582522 chore(windows): move keymanversion.h to common 2022-06-12 13:56:13 +10:00
Marc Durdin
754c1295aa chore(windows): cleanup keyman64.h usage
keyman64.h is now only used by keyman32/keyman64. Shared components have
been moved to legacy_kmx_memory.h - KMX structures in-memory, as used by
kmanalyze, kmdecomp.

Removed unnecessary references to keyman64.h from kmtip.

Also removed aiDebugger.* which are obsolete files.

One day in the future, we could merge keyman64.h with keymanengine.h.
2022-06-12 13:44:56 +10:00
Marc Durdin
d8f3a5598a chore(windows): move various headers to common
* moved ConvertUTF.h -> common/windows/cpp/include
* moved crc32.h -> common/windows/cpp/include
* moved keymansentry.h -> common/windows/cpp/include
* moved registry.h -> common/windows/cpp/include
* moved unicode.h -> common/windows/cpp/include
* moved xstring.h -> common/windows/cpp/include

and updated corresponding references. Deleted a bunch of old references
to missing headers from .vcxproj files. Updated vkeys.h and vkeys.cpp
references in .vcxproj to use $(KEYMAN_ROOT) instead of relative paths.
2022-06-12 13:18:45 +10:00
Marc Durdin
c5332ea20a chore(windows): move keynames.h to common 2022-06-12 12:54:24 +10:00
Marc Durdin
ae0810bc5e chore(windows): move kmtip_guids.h and testkeymanfunctioning.h 2022-06-12 07:43:24 +10:00
Marc Durdin
5119f8d808 chore(windows): merge vkeys.h and move to common
Moves vkeys.h to common, turns it into a proper header and adds
corresponding vkeys.cpp so that we don't include the data multiple times
in a project.

Removes duplication of vkeys.h in kmcmpdll and global/inc.

Updates all projects to reference the common files, except kmdecomp,
coming in the next commit, as it is more complex.
2022-06-12 07:18:36 +10:00
Marc Durdin
e5b31669af chore(developer): move and rename compiler.h
The name compiler.h was misleading, so renamed to legacy_kmx_file.h, as
it largely describes .kmx files. There are two declarations in the file
which are specific to kmcmpdll, at the bottom of the file, but
everything else is all related to the .kmx file format. (We may move
those in a future update to kmcmpdll, but that should wait until the
kmcmpdll cross-platform refactor is complete.)

Moved to common/windows/cpp/include/ because it is used by both
Developer and Windows projects.

Where possible, removed redundant references, as compfile.h includes
legacy_kmx_file.h anyway.
2022-06-12 06:31:38 +10:00
Marc Durdin
5a8ca7ba41 chore(windows): update project references for shared cpp 2022-06-11 08:39:09 +10:00
Ross
c2d478ba4e fix(windows): rename header - review comments 2022-03-22 16:34:46 +10:00
rc-swag
fec2120b2e
fix(windows): address review comments 2022-03-22 13:37:33 +10:00
Ross
79fa9f8a86 fix(windows): create header for keyman guids 2022-03-21 14:58:43 +10:00
Marc Durdin
c9dc10cc33 chore(windows): replace mkver with mkver.sh 2021-12-08 07:10:29 +01:00
Marc Durdin
dee896b4c6 chore(windows): move from Borland make to nmake
While it may be smarter to move to a different build system altogether,
it is also a *lot* more work. This was a fairly minor syntax refresh to
get nmake working with our existing Makefile system. This is now no
longer compatible with Borland make, so you will need to use `nmake` to
build.

The presence of NMAKE.md informs builds systems that nmake should be
used instead of make.
2021-12-06 12:47:31 +04:00
Marc Durdin
e00ff063c8 chore(windows): version.rc use macros instead of mkver 2021-12-05 17:12:56 +11:00
Ross
a4801373db feat(windows): err logs, DEBUG_ASSERT macro
Added some more error logs
Added a DEBUG_ASSERT macro
Update variable names
2021-08-24 17:17:26 +10:00
Ross
3b3ea6e75b feat(windows): clean up formating 2021-08-17 17:16:56 +10:00
Ross
7a9ee207a8 feat(windows): update project include paths for core 2021-08-02 13:13:03 +10:00
Marc Durdin
845d65e5e4 chore(windows): remove backup build step
We no longer need to backup debug files as they are saved to the symbol
store during a release build. This reduces the amount of storage
required for a release build and should speed up the build also.

Also fixes the broken build where backup had not been updated for the
new consistent build paths.
2021-07-07 08:09:26 +10:00
Marc Durdin
5246408ac0 chore(windows): make build paths consistent
More iterations on this yak shave.
2021-07-01 10:52:59 +10:00
Marc Durdin
deb01d1a63 chore(windows): make build paths consistent
Move to all projects using bin/ and obj/ for outputs, and
cleanup all Makefiles and project files accordingly. Remove
some obsolete projects along the way. Cleanup .gitignore
also.
2021-07-01 07:38:00 +10:00
Marc Durdin
f3ba9445dd chore(windows): update vcxproj for vc++2019 2021-05-25 15:58:48 +10:00
Marc Durdin
097ce9ac9a fix(windows): avoid disabling Keyman when speech recognition starts
Fixes #4965.

When speech recognition is enabled, it sometimes activates after a
Keyman keyboard is selected. This would cause Keyman to think it is
being deactivated. We needed to check in
`CKMTipTextService::OnActivated` that it was a keyboard-type TIP that
was being activated, and only deactivate the Keyman hooks in that
situation.

This commit also adds a little logging helper function, and removes an
unused variable `guidActiveProfile`.
2021-04-30 09:04:12 +10:00
Marc Durdin
aae0cb19c4 chore(windows): fully disable auto start task
If the registry setting `HKCU\Software\Keyman
Engine\Debug:Flag_UseAutoStartTask[REG_WORD]` is not `0`, then the this
will enable the restart task. Otherwise, all aspects of it are disabled.

For Keyman 14.0 initial release, we will have this flag disabled. If we
can improve stability of it, we'll consider turning it on.
2021-03-12 16:45:30 +11:00
Marc Durdin
4a74d4767f fix(windows): represerve keys on setfocus
Fixes #4557.

When focus changes, we need to re-run `_PreserveAltKeys` as settings may
have changed, meaning we have to preserve a different set of keys. I
also made the `_PreserveAltKeys` function idempotent so that we don't
have to worry about cleanup before calling it -- by calling the cleanup
function internally instead.
2021-03-09 08:19:23 +11:00
Marc Durdin
9e46b555d9 fix(windows): Rename to Keyman
Fixes #4003.

This addresses the majority of locations where we use the name "Keyman
Desktop" in code. There will be some filenames and paths that do not
change at this point -- particularly at a source level. For now, the
focus is on the user interface changes.

While making these changes, I also made the VERSION and MANIFEST
resources more consistent.
2020-12-02 09:56:14 +11:00
Marc Durdin
00a9744253 chore(windows): symbol server support, initial steps 2020-11-11 10:33:16 +11:00
Marc Durdin
c66eb49163 fix(windows): Start Keyman on Demand - keyman32
This is the first half of a two-part update to Keyman for Windows. There
are two significant changes here. These changes apply to
keyman32/keyman64, as well as kmtip/kmtip64, but will refer to the
32-bit equivalents for simplicity:

1. Instead of using `GetProcAddress` to connect to keyman32.dll, we
   now have an import library connection. This removes one particularly
   suspect piece of architecture for Keyman, as using `GetProcAddress`
   could lead to a race condition, where keyman32.dll is unloaded after
   that function is called but before we use the handle. This makes the
   kmtip.dll build dependent on keyman32.dll; loading kmtip.dll (by
   selecting a Keyman input method) also loads keyman32.dll.

2. It's not enough (yet) to load kmtip.dll. We also need to be running
   keyman.exe itself, due to global hooks that we still require (it may
   be possible, one day, to avoid these, but it doesn't look very
   hopeful). To that end, kmtip calls new function `TIPIsKeymanRunning`
   to check whether keyman32.dll is initialised (and hence keyman.exe
   has initialised it). Then, if keyman.exe is not running, it issues an
   event to the Windows Event Log, which we will pick up with a
   scheduled task in the next PR.

The first part of this is an architectural change which may lead to some
change in behaviours, as keyman32.dll now may not be unloaded from a
process when keyman.exe exits, due to the lock that kmtip.dll now has on
it. It will be important to test this (@MakaraSok) by running through
various startup and shutdown scenarios. In my initial testing, I found
that there were some situations after restarting keyman.exe where I
needed to switch in and out of the Keyman TIP, but those were not all
critical.

This change also lays groundwork for an eventual ability to run the
Keyman input method without keyman.exe running, which will be helpful
e.g. on login screen, even if missing certain additional functionality
such as the serialised input queue.
2020-10-28 06:10:22 +11:00
Marc Durdin
0ab49191d8 fix(windows): buffer overrun in debug function 2020-10-24 14:46:19 +11:00
Marc Durdin
53a197fba5 chore(windows): Move to Windows SDK 10.0.17763.0
This removes the requirement for the Windows 8.1 SDK.
2020-10-05 14:11:34 +11:00
Marc Durdin
f691946f1c fix(windows): coverity reports for kmtip 2020-09-30 17:20:36 +10:00
Marc Durdin
fed63d4690 feat(windows): sentry integration test points 2020-03-31 16:16:56 +11:00
Marc Durdin
3a90f258da [Windows] Fix version.in file encoding back to Windows-1252 2019-10-21 06:43:13 +07:00
Marc Durdin
3589b90d2f [Windows] Add extra logging to help diagnose #2143. 2019-10-01 19:41:40 +10:00
Marc Durdin
08431e89ba [Windows] Add comments 2019-01-08 20:55:19 +11:00
Marc Durdin
5b60359aa2 [Windows] Fix Caps Lock header support 2019-01-08 20:41:29 +11:00
Marc Durdin
988a0917cb [Windows] Switching between Keyman keyboards in same language using TSF interface could fail 2019-01-08 20:33:36 +11:00