Switch text input changed from per-thread to per-user

Platforms

Clients - Windows 8
Servers - Windows Server 2012

Description

Previously, the input language keyboard layout and IME switch, including IME modes, were thread-specific. For instance, if users opened a Notepad file and changed the input language from English to Japanese, and then opened a WordPad file and changed the input language from English to German, the Notepad file would retain Japanese as its input language and the WordPad file would retain German as its input language. In Windows 8 and Windows Server 2012, we are changing from this per-thread approach to a per-user approach. This means that when the input language or IME mode is changed in one app, it applies on other apps when the focus is on the app. In the example above, where users changed the Notepad file input language to Japanese and then opened a WordPad file, the WordPad input language would be Japanese. If users then changed the WordPad input language to German, when they return to the Notepad file, its input language would be in German instead of Japanese. Another example would be if users change the Korean IME mode to AlphaNumeric mode in a Notepad file, and then opens another Notepad file, it too will open in AlphaNumeric mode.

Because the input switch will now be per user instead of per thread by default, some Desktop apps may behave differently. The session starts with the default method and then the current settings follow the focus. The per-user input switch will use the current input method for the newly opened app.

These APIs used in Desktop apps are affected:

The language or IME mode change in these APIs will follow the focus and apply across threads instead of only to the current thread. The per-user input switch is active when the focus is on the foreground. If the API is called after the focus is on the app, the change made by the API will apply to other apps later on when the focus moves to them. If the API is called before the focus is on the app, the language or IME mode change made by the API will be replaced by the per-user input switch with the current input language or IME mode to which the user last switched.

For instance, a user is using English while typing in App A. The user then starts App B, which calls the API ActivateKeyboardLayout to change the input language to German. If the API is called after the focus is on the App B, then the input language is German, not only in App B, but also in App A when the user returns to it. If the API is called before the focus is on App B, then the input language of App B will be English instead of German.

In addition to calling ImmSetConversionStatus, the IME mode could be changed by following the input scope set by the application. Some apps, including Windows Store apps, may set the input scope on certain text fields, such as the Password field, URL field or email field. Certain IMEs react to the Input Scope and change the IME mode according to the input scope.

Japanese Microsoft IME behavior

Japanese IME keeps conversion modes (Hiragana, Halfwidth-AlphaNumeric, Fullwidth-Katakana, Halfwidth-Katakana, and Fullwidth-AlphaNumeric) per application meaning that each application retains conversion mode. This is because conversion mode is attached to application’s particular input field. Microsoft IME will be handled as Hiragana mode after switching the application.

Thus, Japanese Microsoft IME ignores the change of conversion modes made by calling ImmSetConversionStatus when used in per user mode. This API is used in the IME mode property of .NET framework. InputScope is recommended in order to set the IME mode under per user mode in Windows 8.

Manifestation

Files opened in other apps after the input language is changed in the first app, will have the same input language as the initial app.

Mitigation

To reset the input switch from per user to per thread:

  1. Go to the Control Panel.
  2. Select Clock | Language and Region | Language profile.
  3. Click Advanced settings.
  4. In the Switching input method section, check the “Let me set a different input method in each app window” box.
  5. Click Save.

Solution

Keep the per-user mode in mind when developing apps. With the per-user input switch, we do not recommend that the app reset the language or IME mode without the users’ knowledge. If the app needs to change the IME mode, we prefer that it sets the input scope rather than call ImmSetConversionStatus. If an app must rely on a per-thread input switch in order to function, provide a message to the user instructing them to go to the Control Panel and make the change described above.

Resources

Get-WinLanguageBarOption

InputScopeNameValue Enumeration

 

 

Build date: 8/14/2013

Community Additions

Show:
© 2014 Microsoft