Skip to content

chore(window): rename core functions ⛏️#8707

Merged
rc-swag merged 4 commits intochore/windows/8681/remove-addinsfrom
chore/windows/8703/rename-core-functions
May 15, 2023
Merged

chore(window): rename core functions ⛏️#8707
rc-swag merged 4 commits intochore/windows/8681/remove-addinsfrom
chore/windows/8703/rename-core-functions

Conversation

@rc-swag
Copy link
Copy Markdown
Contributor

@rc-swag rc-swag commented May 4, 2023

Fixes #8703
This follows on the removal of addins.

I made the decision to remove

  1. These functions are about saving and restoring the keyboard option list in the core used in the case of testing a keystroke in the NonUpdateable case. Due to the optimisation of just using the cached core actions in the case of the !Updateable call there is no longer a need for these 3 functions and their test cases so can be removed as dead code.
    UpdateKeyboardOptionsCore
    SaveKeyboardOptionsCore
    RestoreKeyboardOptionsCore
    DisposeKeyboardOptionsCore

  2. Removed the core name
    MapKeyboardCore
    MapKeyRuleCore

LoadKeyboardOptionsREGCore -> LoadKeyboardOptionsRegistrytoCore
SaveKeyboardOptionREGCore -> SaveKeyboardOptionCoretoRegistry

User Testing

TEST_KEYBOARDOPTIONS_CHANGE:

This test requires IPA (SIL) keyboard to be installed (or a keyboard that has modifiable keyboard options).
Step 1. Go to Keyman Configuration, select the IPA (SIL) keyboard, click on Keyboard options and choose Before.
Step 2. Open Notepad, start typing anything and notepad should NOT crash.
Step 3. Type > b
Step 4. Expected output ɓ
Step 5. Exit Notepad and Keyman
Step 6. Go to Keyman Configuration, select the IPA (SIL) keyboard, click on Keyboard options and choose After.
Step 7. Type > b
Step 8. Expected output ɓ

Note: Before After setting. This will change the sequence to produce the IPA character for example >b => ɓ for before and if the setting is after it is b> => ɓ

TEST_PRESERVEDKEYS
This is to test the key rules which contain AltGr or Shift + AltGr work correctly.

  • Load a keyboard khmer_angkor

  • Open LibreOffice or Notepad

  • Type a AltGr + o

  • Observere output of ឱ​

  • Type a Shift + AltGr + o

  • Observere output of ᧨

@rc-swag rc-swag self-assigned this May 4, 2023
@rc-swag rc-swag requested a review from ermshiperete as a code owner May 4, 2023 03:17
@keymanapp-test-bot keymanapp-test-bot bot added the user-test-missing User tests have not yet been defined for the PR label May 4, 2023
@keymanapp-test-bot
Copy link
Copy Markdown

keymanapp-test-bot bot commented May 4, 2023

User Test Results

Test specification and instructions

  • TEST_KEYBOARDOPTIONS_CHANGE (PASSED): Tested with the attached PR build (17.0.87-alpha-test-8707) in Windows 10 OS and here is my observation: 1. Installed IPA (SIL) keyboard. Selected 'Before' option from Keyboard options. Verified that after typing >b, it shows ɓ on the Notepad. Then, I selected 'After' option from Keyboard options. Verified that after typing b>, it shows ɓ on Notepad. Working as expected.
  • TEST_PRESERVEDKEYS (PASSED): Tested this as per the instructions in LibreOffice writer document and it showing the expected result. (notes)

Test Artifacts

@rc-swag rc-swag changed the base branch from chore/windows/5442/remove-legacy-keyman-core to chore/windows/8681/remove-addins May 4, 2023 03:45
LoadKeyboardOptionsREGCore -> LoadKeyboardOptionsRegistrytoCore
SaveKeyboardOptionREGCore -> SaveKeyboardOptionCoretoRegistry
@keymanapp-test-bot keymanapp-test-bot bot added has-user-test user-test-required User tests have not been completed and removed user-test-missing User tests have not yet been defined for the PR labels May 4, 2023
@rc-swag rc-swag changed the title chore(window): rename core functions chore(window): rename core functions ⛏️ May 4, 2023
Copy link
Copy Markdown
Contributor

@ermshiperete ermshiperete left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering about the Load/SaveKeyboardOptions* methods - is the "Core" relevant here, or would they be better called LoadKeyboardOptionsFromRegistry and SaveKeyboardOptionsToRegistry?

BOOL IntLoadKeyboardOptionsCore(LPCSTR key, LPINTKEYBOARDINFO kp, km_kbp_state* const state);
void IntSaveKeyboardOptionREGCore(LPCSTR REGKey, LPINTKEYBOARDINFO kp, LPCWSTR key, LPWSTR value);
BOOL IntLoadKeyboardOptionsRegistrytoCore(LPCSTR key, LPINTKEYBOARDINFO kp, km_kbp_state* const state);
void IntSaveKeyboardOptionCoretoRegistry(LPCSTR REGKey, LPINTKEYBOARDINFO kp, LPCWSTR key, LPWSTR value);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to add an s to make the names between loading and saving consistent? (Similar in the other method names)

Suggested change
void IntSaveKeyboardOptionCoretoRegistry(LPCSTR REGKey, LPINTKEYBOARDINFO kp, LPCWSTR key, LPWSTR value);
void IntSaveKeyboardOptionsCoretoRegistry(LPCSTR REGKey, LPINTKEYBOARDINFO kp, LPCWSTR key, LPWSTR value);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Loading and Saving are not exactly symmetrical. The Loading works on a list of options whereas saving saves only a single option, it is a deliberate option to leave the s off.

@bharanidharanj
Copy link
Copy Markdown

  • TEST_KEYBOARDOPTIONS_CHANGE (PASSED): Tested with the attached PR build (17.0.87-alpha-test-8707) in Windows 10 OS and here is my observation: 1. Installed IPA (SIL) keyboard. Selected 'Before' option from Keyboard options. Verified that after typing >b, it shows ɓ on the Notepad. Then, I selected 'After' option from Keyboard options. Verified that after typing b>, it shows ɓ on Notepad. Working as expected.

@bharanidharanj
Copy link
Copy Markdown

Test Results

  • TEST_PRESERVEDKEYS (PASSED): Tested this as per the instructions in LibreOffice writer document and it showing the expected result.

@keymanapp-test-bot keymanapp-test-bot bot removed the user-test-required User tests have not been completed label May 4, 2023
@darcywong00 darcywong00 added this to the A17S12 milestone May 5, 2023
@mcdurdin mcdurdin linked an issue May 5, 2023 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

@ermshiperete ermshiperete left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but flagging as "Request changes" so that my questions don't slip off the radar with multiple comments after them...

@mcdurdin mcdurdin modified the milestones: A17S12, A17S13 May 14, 2023
@rc-swag rc-swag merged commit 9e8b52b into chore/windows/8681/remove-addins May 15, 2023
@rc-swag rc-swag deleted the chore/windows/8703/rename-core-functions branch May 15, 2023 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore(windows): Rename functions if "Core" in name is redundant ⛏️

5 participants