feat(windows): preserving keyboard options in engine#5668
Conversation
This functions was to update the keyboard options in the windows engine with the current options in the core However it is not needed as first thought. This is because the options will not be updated in first Non updatable call kmtip. This is due to the fact the actions will not be processed. A variation on the current core implementation. I am still pushing the branch as the unit test will be usefull.
Add save and restore methods for saving and restoring keyboard processor options.
User Test Results
|
User TestingThe test cases below uses the options_set.kmp keyboard. That keyboard outputs a toggled string to easily identify if the toggle has occurred twice for a single key press. The tester can use other keyboards where they are aware the "set Install options_set.kmp
press and release a |
|
mcdurdin
left a comment
There was a problem hiding this comment.
I think there is some memory leaking happening with keyboard option keys and values
Co-authored-by: Marc Durdin <marc@durdin.net>
mcdurdin
left a comment
There was a problem hiding this comment.
This is looking good despite all my comments ;-)
| DisposeKeyboardOptionsCore(&SavedKBDOptions); | ||
| SavedKBDOptions = NULL; |
There was a problem hiding this comment.
Do you want to move the second line of this into DisposeKeyboardOptionsCore, given we are using that pattern elsewhere?
| // Include the standard header and generate the precompiled header. | ||
| // | ||
|
|
||
| /** |
There was a problem hiding this comment.
All this really shouldn't be in pch.cpp, which should only be a stub for precompiled headers.
There was a problem hiding this comment.
All this really shouldn't be in pch.cpp, which should only be a stub for precompiled headers.
Ok I will move it all out to gtest_main.cpp as that makes it clear what it really is after all. I could go with gtest_mem as the original authour did but gtest_main is even clearer.
I will revert pch.cpp to just being a stub.
I have probably have set this keyboard up incorrectly. It wants English Australia (en-AU). However, it doesn't get you to install it. On my system it is available. @MakaraSok If under the configuration of this I will make it build it again also this time with US because the test is so basic it doesn't need en-AU. |
Co-authored-by: Marc Durdin <marc@durdin.net>
| * @copyright (c) 2013 Stephan Brenner | ||
| * @license This project is released under the MIT License. | ||
| * | ||
| * Adapted in 2021 from the gtest_mem.cpp |
There was a problem hiding this comment.
Let's add a link to the original repo
|
@mcdurdin - What are your thoughts of checking in the options_set.kmp test keyboard to windows/src/test/manual-tests/ ? |
|
@darcywong00, at this stage, no need -- it's attached to this PR. |
|
@keymanapp-test-bot retest I have changed the |
|
…ws/preserving-keyboard-options-in-engine

Fixes #5653
Three functions are added
SaveKeyboardOptionsCoreUpdateKeyboardOptionsCoreandRestoreKeyboardOptionsCore.To facilitate in saving the keyboard processors keyboard options and then also restoring them.
Unit tests have also been added to test the added functions.