unit test for structure sizes. This validates that the Pascal and C++
structure definitions are identical in size for each platform that they
are compiled for (x86 and x64).
Note that this uncovered an existing discrepancy in FILE_KEYBOARD. ;-)
Just refactoring minor bits and pieces on this PR. Esp: removed the
unnecessary interrogation of TSF (yay!) and cached the debug flag so it
isn't checked on every single keystroke.
Fixes#364.
Hotkeys in Windows are currently implemented using RegisterHotkey.
However RegisterHotkey does not distinguish between left and right
modifier keys, which means that they override some keyboards' RAlt
combinations.
This feature reimplements hotkey support in the low level keyboard hook,
and adds a feature flag / debug flag Flag_UseRegisterHotkey to return
to the RegisterHotkey model if that is so needed.
I have made minimal refactoring changes to this code, although there
are certainly functions here which could be improved.
I have flagged a couple of potential improvements with TODO.
The .keyboard_info merge of `platformSupport` would not always give the
right result, for .js keyboards. We have a certain lack of information
in the .js which makes it a little tricky to determine precisely what
the set of supported platforms are. Thus, if we find a .js within a
.kmp, we'll assume it supports mobile; if we find a .js by itself,
we'll assume it supports web. (Thus, a keyboard that builds a .js
is assumed to always support web -- but not necessarily mobile now).
Some keyboards that have incorrectly added a .js into a package, e.g.
sil_cipher_music, will be marked as supporting mobile even though they
don't. The correct fix here is to remove the .js from the package for
that keyboard.
The focus code paths for Chromium frames (CEF4Delphi) were incorrect.
The return value for preventing focus on navigation events was
inverted, and then other code was attempting to work around this
inversion, wrongly. Fixed the root issue of the inverted test (it would
help if the parameter cefSetFocus was known as `Handled` rather than
`Result`!) and then the remaining code pathways became far simpler.
Fixes#2314.
If the On Screen Keyboard was closed when on a monitor other than the
primary monitor, it would restore to the primary monitor in the top-
left corner instead of the previous location.
This fix allows the OSK to be restored to another monitor, but still
avoids positioning the window off screen if the monitor has been
disconnected.
Fixes#2270.
Fixes#2147.
This potentially addresses the issues reported in #2147 where Keyman
would crash due to a race condition as a critical section was not
deleted before attempting to recreate it.
Some logging has been added for debugging these issues.
Also fixes memory leaks and another race on startup relating to loading
the taskbar icon.
There are still some known memory leaks because DLL_THREAD_DETACH is
not called for all threads before keyman32.dll is unloaded, so those
threads don't get the opportunity to clean themsselves up. However, the
key danger with the csGlobals critical section has been addressed.