Commit graph

24 commits

Author SHA1 Message Date
Ross
dbc950741a fix(windows): change variable name add comments 2022-03-18 14:41:26 +10:00
Ross
d58a8c97d8 fix(windows): add threat check 2022-03-18 08:25:45 +10:00
Ross
be333860f0 fix(windows): framework for switching of pipeline
We want to be able to switch of the seralized pipeline if a keyman
keyboard is not active. To do this we need to store this information
in a way the seralized thread can get the information.
2022-03-17 13:02:50 +10:00
Ross
d5e228d6cc fix(windows): update comment remove casts 2022-02-10 11:48:06 +10:00
Ross
8c8859bcf1 feat(windows): add process_queued_actions 2022-01-20 14:33:00 +10:00
Ross
7efb4b1756 feat(windows): add wm_kewm_keymanim_close for core
This commit adds call to the core keyboard processor
on wm_keymanim_close event. To get the latest actions.
It also changes the core to allow QIT BACK even when
the context is empty.
2022-01-13 13:59:43 +10: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
0f4e3d1768 feat(windows): core saving context null pointer check 2021-08-17 14:10:44 +10:00
Marc Durdin
d26b01ad99 chore(windows): remove KMC_CHANGEUISTATE
The `KMC_CHANGEUISTATE` flag for `wm_keyman_control` is no longer
processed anywhere. Removes it and the `UpdateKeymanUI` function which
called it.

The `#define` for the flag has been left, commented out, to clarify what
would otherwise be a gap in identifiers (use `git blame` to learn more).
2021-05-11 15:19:01 +10:00
Marc Durdin
fbcfd62678 fix(windows): refactor controller windows
Fixes #5004.

This cleans up the use of controller windows. A single window is now
given the responsibility of being the master controller, which receives
messages from Keyman32 and other components around UI activation, active
keyboard, etc.

The master controller is keyman.exe's `TApplication` window, which does
not get destroyed and recreated, unlike the main form window.

Any thread which has responsibility for Keyman UI (keyman.exe main
thread, keymanx64.exe main thread) is also registered as a controller
thread. A controller thread has special handling for interactions with
keyman32 around focus tracking.

Caveats:

* While keymanx64 does not have a visible window and thus probably does
  not need to be registered as a controller thread, it doesn't really
  hurt.
* Note that keymanx64 registers the 32-bit controller thread as well,
  which again is probably unnecessary as the 64-bit process cannot
  interact with the 32-bit thread.
* Keyman's main form still handles wm_keyman_control messages, as there
  are a number of other components which post to that window (e.g. text
  editor, com library visual keyboard interactions). Unlike the original
  problem trigger, the reference handle is not stored long-term and so
  there is unlikely to be a problem with main form window re-creation
  causing an issue in these contexts.

There are several TODO items in this which I will address in follow-ups,
to reduce the scope of these changes.

I hope to cherry-pick this to stable-14.0, but will run for a while in
15.0 before doing so.
2021-05-11 14:47:17 +10:00
Marc Durdin
d7e4e18987 fix(windows): Handle Caps Lock event correctly from TIP
Fixes #4525.

This is a regression from #4468, which inadvertently added modifier
checks for `VK_CAPITAL` and `VK_NUMLOCK`, when it should not have done
so, as the flag was then being reset when the key was released rather
than toggled.

`ProcessModifierChange` pretended that it could handle `VK_CAPITAL` and
`VK_NUMLOCK` but it would never have worked, and the other caller (the
GetMessage hook) never passed those key events through, only Shift, Ctrl
and Alt, so that's now what the TIP handler does as well.

This leaves the rest of the fix from #4468 in place as that appears
correct.

I took the opportunity to move a repeated function declaration into
keyman64.h.
2021-02-26 10:54:30 +11:00
Marc Durdin
32d42d7d31 fix(windows): Track modifier changes in UWP apps
Fixes #4369.

When Keyman is not handling a particular virtual key, it does not
preserve the virtual key (TSF terminology, essentially reserves that
virtual key + modifier for Keyman). In this situation, Keyman still
receives and processes the virtual key event, but the modifier state
is not passed through by kmtip to keyman32. This is normally okay,
because our `GetMessage` hook is responsible for tracking modifiers.

However, in UWP apps, our `GetMessage` hook does not get run, and so
we lose the modifier keys. Thus, this update ensures that the modifier
keys are processed when received by the TSF TIP.

It does not hurt to process modifier events twice.
2021-02-11 10:17:21 +11:00
Marc Durdin
cea564a072 fix(windows): Improve refresh performance
When a keyboard is installed, Keyman will now only refresh its internal
state on a given thread when that thread receives focus and/or input,
rather than immediately. This will dramatically reduce the chatter
caused by Keyman Engine when a keyboard is installed or settings are
changed.
2020-12-17 11:13:18 +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
fc7b51c4ca fix(windows): remove msctf free from DllMain
Fixes #3650.

This removes the bad call to `FreeLibrary` that was still present in
a callee of `DllMain` in keyman32. The refactor moves responsibility for
loading TSF to the `SelectKeyboard` functions and gets rid of the
associated thread globals.

The `TSFINTERFACES` struct is of course a future candidate for a class.

In the process I removed a lot of cruft from keyman32.cpp which was
either obsolete, irrelevant or just plain wrong. None of which had
material impact on the running code.
2020-10-28 16:17:52 +11:00
Marc Durdin
0406cb1381 fix(windows): coverity reports for keyman32 2020-10-02 14:54:43 +10:00
Marc Durdin
d8c45f25dc [Windows] Address review comments 2018-10-29 16:34:00 +11:00
Marc Durdin
b395f7b122 [Windows] Remove USE_SERIALEVENTSERVER define 2018-10-19 05:34:48 +11:00
Marc Durdin
738e1946a6 [Windows] Debug logging and proof of concept tests for keyboarding support within metro-style apps
[Windows] More tidyup and robustness for metro app support - debug cleanup and serialization of input (not quite finished)

[windows] Refactor serialized input code when used with key event thread model

[windows] Add consistent precompiled headers for other projects

[windows] Merge console window test into metro support

[Windows] Tidy up work and identify additional TODOs for metro-style app support

[Windows] Ensure error case falls through to default hook processing for console windows

[Windows] Refactor shared memory into memory mapped file so we can cross 32-64 bit boundary

[Windows] Tweaks to C++ security calls and parameters

[Windows] Start refactor of SerialKeyEvent* classes

[Windows] Rename to SerialKeyEventServer (refactoring)

[Windows] Complete refactoring of SerialKeyEventClient class

[Windows] Further encapsulation and cleanup with 'interfaces' to reduce header pollution

[Windows] Complete serialization fix with move of modifier state management from client thread to server thread to guarantee consistency

[Windows] Replace atom-based keyboard switching with memory mapped file indexed to avoid security constraints

[Windows] Fixup Left Alt+Shift interaction with serializer

[Windows] Use Windows 8.1 SDK for test
2018-10-18 20:00:49 +11:00
Marc Durdin
56115da652 [Windows] Serialized input: don't trigger on console windows 2018-10-05 14:40:57 +10:00
Marc Durdin
7e2c21b8a7 [Windows] Refactor serialized input to use a low level keyboard hook to avoid conflicts 2018-10-03 15:22:38 +10:00
Marc Durdin
d2331680b2 [Windows] Address review comments, document, and tidy up constants 2018-10-03 07:01:34 +10:00
Marc Durdin
eff9f834de [Windows] Serialize the processing of true key events and simulated key events generated by Keyman 2018-10-02 10:38:33 +10:00
Marc Durdin
b65b982584 Keyman Desktop and Keyman Developer open source 10.0 alpha seed (#121)
* Keyman for Windows 10.0 Open Source

* Squashed 'windows/src/ext/jedi/jedi/' content from commit f444ad2

git-subtree-dir: windows/src/ext/jedi/jedi
git-subtree-split: f444ad2da4693851e523f1ea6bd541f701904c24

* Squashed 'windows/src/ext/jedi/jcl/' content from commit d63d3c9fd

git-subtree-dir: windows/src/ext/jedi/jcl
git-subtree-split: d63d3c9fd9ff84efdd8159084ec6a60313644243

* Squashed 'windows/src/ext/jedi/jvcl/' content from commit bee19f3b4

git-subtree-dir: windows/src/ext/jedi/jvcl
git-subtree-split: bee19f3b46909fde2fa92c06cd2706f41d99f6c3

* Add required .res files

* Add required .res files

* Add docbook files (forced)

* Add required libxslt

* Add required jedi files

* Add installation files

* Tweak .gitignore for open

* CI

* Remove KMW from Developer source (#122)

* Remove KMW from Developer source (copies during build)

* Remove KMW from Developer source (copies during build)

* Remove KMW from Developer source (copies during build)

* Fixup release build and copy license, readme from kmw during build

* Remove obsolete build help documentation

* Keyman Engine 10 on Windows regression for shift states (#129)

* Improve #128 -- cleaner debug messages

* Fixes #127, shift state now resets correctly; and more work for #128

* Fixes #130 (#131)
2017-07-25 10:53:06 +07:00