Skip to content

feat(windows): Keyman Core Integration - Support for IMX DLLs 🥑 #5936

Merged
rc-swag merged 40 commits intomasterfrom
feat/windows/imx-support-common-core
Jan 26, 2022
Merged

feat(windows): Keyman Core Integration - Support for IMX DLLs 🥑 #5936
rc-swag merged 40 commits intomasterfrom
feat/windows/imx-support-common-core

Conversation

@rc-swag
Copy link
Copy Markdown
Contributor

@rc-swag rc-swag commented Nov 18, 2021

Fixes #5650

@keymanapp-test-bot keymanapp-test-bot bot added the user-test-missing User tests have not yet been defined for the PR label Nov 18, 2021
@keymanapp-test-bot
Copy link
Copy Markdown

keymanapp-test-bot bot commented Nov 18, 2021

User Test Results

Test specification and instructions

✅ SUITE_SIMPLIFIED_CHINESE:

  • TEST_SIMPLIFIED_SINGLE (PASSED): The IMX works and the expected character got output when tested in Notepad.
  • TEST_SIMPLIFIED_MULTIPLE (PASSED): The IMX works and the expected character got output when tested in Notepad.
  • TEST_SIMPLIFIED_BACKSPACE_1 (PASSED)
  • TEST_SIMPLIFIED_BACKSPACE_2 (PASSED)

✅ SUITE_IMSAMPLE_KEYBOARD:

✅ SUITE_IMSAMPLE_KEYBOARD_IM_WINDOW:

  • TEST_IMSAMPLE_INPUT_IMW (PASSED)
  • TEST_IMSAMPLE_INPUT_IMW_CONT (PASSED)
  • TEST_IMSAMPLE_BACKSPACE_IMW (PASSED)

Test Artifacts

@rc-swag rc-swag changed the title Feat/windows/imx support common core feat(windows): Keyman Core Integration - Support for IMX DLLs 🥑 Nov 18, 2021
@rc-swag rc-swag closed this Nov 19, 2021
@rc-swag rc-swag reopened this Nov 19, 2021
@rc-swag rc-swag force-pushed the feat/windows/preserved-key-support branch from c154681 to cfed6f1 Compare November 29, 2021 00:55
Base automatically changed from feat/windows/preserved-key-support to master November 29, 2021 04:48
@rc-swag rc-swag force-pushed the feat/windows/imx-support-common-core branch from 76f8fc4 to d8a6d5a Compare December 19, 2021 23:50
@rc-swag
Copy link
Copy Markdown
Contributor Author

rc-swag commented Dec 23, 2021

An outstanding issue is if an IM window is up waiting for a user code point selection and other keys are pressed on the keyboard those characters will be added to the context and output before the select character from the IMC window. This behaviour is the same as the current windows implementation. However, the core implementation the character entered is output 3 times.
For example with IM Test Loaded Open notepad
Type d then a which will then wait for input from the IMC window, before selecting a character press t.
Then select "æ"
The output in the app will be: dtttæ

Looking at the logging I can see that
if (fOutputKeystroke && !_td->app->IsQueueEmpty()) { in kmprocess.cpp ProcessHook is evaluating to true and the
key gets synthesised twice. The action to output the char is already in the queue (which is why the if evaluates to true). Therefore the key is added 3 times.

@rc-swag
Copy link
Copy Markdown
Contributor Author

rc-swag commented Jan 5, 2022

User Testing

Note there is another issue #6099 that fixes an issue for the IMX simplified Chinese keyboard where the enter key does not output to the app. So that is a known limitation in this PR.

SUITE_SIMPLIFIED_CHINESE:

This keyboard will display the IMX window as soon as a string the matches the pinyin for one or more characters are typed.
For all these tests install the Simplified Chinese Keyboard cs-pinyin.cmp

Note: Enter does not work for this keyboard and will be addressed in issue #6099

  • TEST_SIMPLIFIED_SINGLE:
    Using Notepad or equivalent.
  • Type o - The IMX window should appear
  • Choose the 4th option
  • Expected result: 喔
  • TEST_SIMPLIFIED_MULTIPLE:
    Using Notepad or equivalent.
  • Type h a n z i - The IMX window will appear and in the top left the letters hanzi will be present
  • Choose the 5th option
  • Expected result: 汉字变换
  • TEST_SIMPLIFIED_BACKSPACE_1:
    Using Notepad or equivalent.
    This is to test the backspace occurring mid pinyin sequence before a character is output to the app
  • Type h a n z i - The IMX window will appear and in the top left the letters hanzi will be present
  • Press Backspace twice - The IMX window should now have the top left letters of han.
  • Choose the 5th option
  • Expected result: 汗
  • TEST_SIMPLIFIED_BACKSPACE_2:
    Using Notepad or equivalent.
    This is to test the backspace of already output characters.
  • Type h a n z i - The IMX window will appear and in the top left the letters hanzi will be present.
  • Choose the 5th option
  • Expected result: 汉字变换
  • Press Backspace twice
  • Expected result: 汉字

SUITE_IMSAMPLE_KEYBOARD:

imsample.zip <- @MakaraSok this is the latest here
This is the replacement build for impsample keyboard
This keyboard uses the letters aeom to allow IMX input. This keyboard is a bit flakey being a demo and not polished.
It also takes some setting up the following registry keys need to be added and set once installed.
The location of the registry keys are at.
Computer\HKEY_CURRENT_USER\SOFTWARE\Keyman\Keyman Engine\Active Keyboards\imsample
and are of type REG_DWORD
The keys are ShowIMWindow and ShowIMWindowAlways they both need to be set to 0.

In this mode IM window is not shown rather the app text is updated with a menu when either aeom is pressed.
For example when type he the text will become h[1ɛ 2ɜ 3ə 4e 5ɘ] then you type the number 3 the text displayed should now be

  • TEST_IMSAMPLE_INPUT:
  • Install Imsample keyboard attached to this PR.
  • Select the keyboard its name is IMTest
  • Type some keys that are not the special keys e.g. t r y
    • Type the space key then a then type 1 to get the 1st option
  • Expected Result: try æ
  • continue to the next test
  • TEST_IMSAMPLE_INPUT_CONT:
    ... contd from above
  • Type 'm' and type 3 to get ### option
  • Expected Result: try æ###
  • TEST_IMSAMPLE_BACKSPACE:
    Using Notepad or Libreoffice
  • Type f
  • Type e
  • The screen should have f[1ɛ 2ɜ 3ə 4e 5ɘ]
  • Now press Backspace. the whole option menu including the square brackets [ ] should be deleted.
  • Expected result f
  • TEST_IMSAMPLE_BACKSPACE_2:
    Using Notepad or Libreoffice
  • Before typing, any characters press the backspace key
  • Observe that Keyman does not crash or cause the app to behave in an unexpected way.
  • Type random letters including special characters using the menu (as in TEST_IMSAMPLE_INPUT...)
  • Press Backspace until all characters are deleted.
  • Expected result all characters are successfully removed.

SUITE_IMSAMPLE_KEYBOARD_IM_WINDOW:

This keyboard uses the letters aeom to allow IMX input. This time a IM window should display.
It also takes some setting up the following registry keys need to be added and set once installed.
The location of the registry keys are at.
Computer\HKEY_CURRENT_USER\SOFTWARE\Keyman\Keyman Engine\Active Keyboards\imsample
and are of type REG_DWORD
The keys are ShowIMWindow and ShowIMWindowAlways they both need to be set to 1.

Also in this location is two keys imsample x and imsample y There seems to be a bug and they get set to some huge number so you need to set impsample x to 100 and imsample y to 50

  • TEST_IMSAMPLE_INPUT_IMW:
  • Install Imsample keyboard attached to this PR (if not done already)
  • Select the keyboard its name is IMTest
  • Type some keys that are not the special keys e.g. t r y
  • Type the space key then a then click the 1st option
  • Expected Result: try æ
  • continue to the next test
  • TEST_IMSAMPLE_INPUT_IMW_CONT:
    ... contd from above
  • Type 'm' and select the 3rd ### option
  • Expected Result: try æ###
  • TEST_IMSAMPLE_BACKSPACE_IMW:
    Using Notepad or Libreoffice
  • Before typing, any characters press the backspace key
  • Observe that Keyman does not crash or cause the app to behave in an unexpected way.
  • Type letters including special characters using the IM window (as in TEST_IMSAMPLE_INPUT...)
  • Press Backspace until all characters are deleted.
  • Expected result all characters are successfully removed.

@keymanapp-test-bot keymanapp-test-bot bot added 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 Jan 13, 2022
@MakaraSok
Copy link
Copy Markdown

All tests done in Windows 10 Pro 21H1 (VBox machine)

SUITE_SIMPLIFIED_CHINESE:

  • TEST_SIMPLIFIED_SINGLE: FAILED the IMX window doesn't appear after pressing o. It seems like the keyboard (cs-pinyin) doesn't work at all. The same issue is experienced in LibreOffice.
  • TEST_SIMPLIFIED_MULTIPLE: BLOCKED It seems like the keyboard (cs-pinyin) doesn't work at all.
  • TEST_SIMPLIFIED_BACKSPACE_1: BLOCKED It seems like the keyboard (cs-pinyin) doesn't work at all.
  • TEST_SIMPLIFIED_BACKSPACE_1: BLOCKED It seems like the keyboard (cs-pinyin) doesn't work at all.

SUITE_IMSAMPLE_KEYBOARD:

They two keys have been added and the value set to "0" like so:

  • TEST_IMSAMPLE_INPUT: FAILED the IMX window doesn't appear after pressing o. It seems like the keyboard (cs-pinyin) doesn't work at all. The same issue is experienced in LibreOffice.
  • TEST_IMSAMPLE_INPUT_CONT: BLOCKED
  • TEST_IMSAMPLE_BACKSPACE: BLOCKED
  • TEST_IMSAMPLE_BACKSPACE: BLOCKED

SUITE_IMSAMPLE_KEYBOARD_IM_WINDOW:

They two keys' value is set to "1" like so:

  • TEST_IMSAMPLE_INPUT_IMW: FAILED the IMX window doesn't appear after pressing o. It seems like the keyboard (cs-pinyin) doesn't work at all. The same issue is experienced in LibreOffice.
  • TEST_IMSAMPLE_INPUT_IMW_CONT: BLOCKED
  • TEST_IMSAMPLE_BACKSPACE_IMW: BLOCKED

@rc-swag
Copy link
Copy Markdown
Contributor Author

rc-swag commented Jan 23, 2022

I will look into this straight away. However, just noting test SUITE_IMSAMPLE_KEYBOARD The IM window is not meant to show.
In this mode IM window is not shown rather the context is update with a menu when either aeom is pressed.
For example when you type the text will become h[1ɛ 2ɜ 3ə 4e 5ɘ] then is you type the number 3 the text displayed should now be hə

It is though in the third Suite SUITE_IMSAMPLE_KEYBOARD_IM_WINDOW

@mcdurdin mcdurdin modified the milestones: A15S22, B15S1 Jan 24, 2022
@MakaraSok
Copy link
Copy Markdown

I will look into this straight away. However, just noting test SUITE_IMSAMPLE_KEYBOARD The IM window is not meant to show.

Everything is copied from the "User Test Results" above. Nothing has been changed, except the results of the test and comments.

Please double check the user test instructions provided.

rc-swag and others added 5 commits January 24, 2022 16:05
…okes-from-imx

feat(windows): emit keystrokes for imx keydown/up actions 🥑
The windows engine shift modifier flag needs to only pass
the K_MODIFIERFLAGS so do a bit wise and to clear the other flags
@MakaraSok
Copy link
Copy Markdown

SUITE_SIMPLIFIED_CHINESE:

  • TEST_SIMPLIFIED_SINGLE: PASSED The IMX works and the expected character got output when tested in Notepad.
  • TEST_SIMPLIFIED_MULTIPLE: PASSED The IMX works and the expected character got output when tested in Notepad.
  • TEST_SIMPLIFIED_BACKSPACE_1: PASSED The IMX works and the expected character got output when tested in Notepad.
  • TEST_SIMPLIFIED_BACKSPACE_1: FAILED when pressing the backspace twice for the second time, nothing is left in the line.

SUITE_IMSAMPLE_KEYBOARD:

  • TEST_IMSAMPLE_INPUT: FAILED Keyman crashes when typing either "he" or "try".
    Here is what's set in RegEdit:


  • TEST_IMSAMPLE_INPUT_CONT: BLOCKED Not testable because of the issue right above.
  • TEST_IMSAMPLE_BACKSPACE: BLOCKED Not testable because of the issue right above.
  • TEST_IMSAMPLE_BACKSPACE: BLOCKED Not testable because of the issue right above.

SUITE_IMSAMPLE_KEYBOARD_IM_WINDOW:

  • TEST_IMSAMPLE_INPUT_IMW: FAILED Keyman crashes when tryping "try a".
Screen.Recording.2022-01-25.at.4.32.22.PM.mov
  • TEST_IMSAMPLE_INPUT_IMW_CONT: BLOCKED
  • TEST_IMSAMPLE_BACKSPACE_IMW: BLOCKED

@MakaraSok
Copy link
Copy Markdown

@rc-swag Please refer me to the latest keyboard package for testing this. Thanks.

@MakaraSok
Copy link
Copy Markdown

Also, please double check the test cases and ensure that there is no additional/duplicate cases in the sets/suites. Thanks.

@rc-swag
Copy link
Copy Markdown
Contributor Author

rc-swag commented Jan 26, 2022

Also, please double check the test cases and ensure that there is no additional/duplicate cases in the sets/suites. Thanks.

I tagged you in the test instructions were the Imsample.zip contains the latest keyboard. It was also in the conversation history but I removed it to avoid any confusion.

I have been through the test instructions I renamed a duplicate name in the simplified Chinese backspace check.

@MakaraSok
Copy link
Copy Markdown

SUITE_SIMPLIFIED_CHINESE:

  • TEST_SIMPLIFIED_BACKSPACE_1: PASSED
  • TEST_SIMPLIFIED_BACKSPACE_2: PASSED

SUITE_IMSAMPLE_KEYBOARD:

  • TEST_IMSAMPLE_INPUT: PASSED

  • TEST_IMSAMPLE_INPUT_CONT: PASSED

  • TEST_IMSAMPLE_BACKSPACE: PASSED

  • TEST_IMSAMPLE_BACKSPACE_2: PASSED

SUITE_IMSAMPLE_KEYBOARD_IM_WINDOW:

Here is the settings I have in the regedit:

  • TEST_IMSAMPLE_INPUT_IMW: PASSED
  • TEST_IMSAMPLE_INPUT_IMW_CONT: PASSED
  • TEST_IMSAMPLE_BACKSPACE_IMW: PASSED

@keymanapp-test-bot keymanapp-test-bot bot removed the user-test-required User tests have not been completed label Jan 26, 2022
@rc-swag rc-swag merged commit 229ba42 into master Jan 26, 2022
@rc-swag rc-swag deleted the feat/windows/imx-support-common-core branch January 26, 2022 23:38
@keyman-server
Copy link
Copy Markdown
Collaborator

Changes in this pull request will be available for download in Keyman version 15.0.187-alpha

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.

feat(windows): Keyman Core Integration - Support for IMX DLLs 🥑

4 participants