How does the on screen keyboard detect user switch input method

Mj Chen 1 Reputation point
2021-07-02T08:45:37.213+00:00

When using English input method, the OSK interface is as follows
111290-1.jpg

When using Japanese input method, the interface of OSK is as follows
111361-2.jpg

How does OSK know that the user has switched and then changed the UI interface?

Windows for business | Windows Client for IT Pros | User experience | Other
{count} votes

4 answers

Sort by: Most helpful
  1. Castorix31 90,686 Reputation points
    2021-07-02T09:14:17.87+00:00

    It receives a custom message (WM_USER + 101) where it checks the language with GetKeyboardLayout

    0 comments No comments

  2. Mj Chen 1 Reputation point
    2021-07-02T09:37:34.45+00:00

    Therefore, OSK can correctly switch the UI layout Because of receiving windows messgae and using GetKeyboardLayout to check right?Is it possible to identify by querying the registry edit?

    0 comments No comments

  3. Percival Yang 731 Reputation points
    2021-07-05T07:21:51.4+00:00

    Hi,

    Glad to help you, you might notice that the mechanism of OSK switch input language synchronize with hardware keyboard settings. There have simple options to change hotkeys about switching input languages.

    Search→Typing→More Keyboard settings→advanced keyboards settings→input language hotkeys→change key sequence.

    If you change the setting, it will also affect the OSK which means the registry editor also works. But before, you have to know it is not easy for you edit to the registry.

    https://www.experts-exchange.com/articles/2155/Keyboard-Remapping-CAPSLOCK-to-Ctrl-and-Beyond.html

    Note: Since the websites are not hosted by Microsoft, the links may change without notice. Microsoft does not guarantee the accuracy of this information.

    Once, you create the scancode key, you can just delete the Scancode map in the following link to restore the changes.
    Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout

    Hope this can help you

    If your need further help, be free reply to me at your convenience.

    ==============================================================================
    If the Answer is helpful, please click "Accept Answer" and upvote it


  4. Mj Chen 1 Reputation point
    2021-07-08T03:43:02.257+00:00

    Hi Castorix31,
    I want to detect the input method switch when I switch the input method (as shown in the picture below), my program must be able to detect the input method change.Even between English US keyboard and English Czech keyboard.
    112716-untitled.png

    I create a windows desktop application like this
    112798-screenshot-2021-07-08-112429.jpg

    and use ITfInputProcessorProfileActivationSink to achieve the function I want.
    Now i have a problem. When i set this GUI attributes to hide and change input method, i can't detect any input method change.
    Are there any parameters I ignore.
    thanks


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.