Solving keyboard layout issues in an ICA or RDP session

Solving keyboard layout issues in an ICA or RDP session can be quite tricky. In this article I deal with some of the common causes and their solutions.

The issues and solutions in this article apply to XenDesktop / Citrix Virtual Apps and Desktops (CVAD) version 7.12 and higher and Citrix Receiver 4.6 and higher.

A list of the most common issues

Let's start with a list of the most common keyboard layout issues. Each issue is linked to a section in this article that describes the causes and solutions:

As you can see in the previous list, keyboard layout issues can present themselves in different ways. The following paragraphs describe the causes and solutions for each of the scenarios above.

Common causes and solutions for issue 1 "the keyboard layout changes unexpectedly at logon"

There are at least three possible reasons why either the local keyboard layout or server-side keyboard layout is used at session launch:

  1. The registry value IgnoreRemoteKeyboardLayout is either configured or missing
  2. Citrix Workspace app is configured to use either the local or remote keyboard layout (APPSRV.ini)
  3. Local IME (and the keyboard synchronization feature) has been enabled or disabled on the Citrix worker (VDA)

The registry value IgnoreRemoteKeyboardLayout is either configured or missing

The registry value IgnoreRemoteKeyboardLayout is a "golden oldie" in the world or Remote Desktop Services and Citrix. This value is configured on the Remote Desktop Session Host or Citrix worker (VDA).

First of all, IgnoreRemoteKeyboardLayout is a registry value that you set on the Citrix worker (the VDA):

  • Key: HKLM\SYSTEM\CurrentControlSet\Control\Keyboard Layout
  • Name: IgnoreRemoteKeyboardLayout
  • Value: 1
  • Type: DWORD

A reboot is not necessary. For this value to take effect you only need to close your current RDP or ICA session (in case you have one open) and launch a new session. This setting is a local machine setting, so it applies to all users (and administrators!).

As said, this registry setting has been around forever and still applies to all server operating systems including the latest one, Windows Server 2019.

So what exactly does this setting do? Well, when an RDP or ICA session is launched, instead of using the keyboard layout set on the local client device, the keyboard layout set in the user's (roaming) profile within the RDP or ICA session is used. To be more precise; the keyboard layout that is listed first in the current user registry hive HKCU\Keyboard Layout\Preload in the user's (roaming) profile is used.

Solving keyboard layout issues - AppSRVINI keyboard user profile

By default, the registry value IgnoreRemoteKeyboardLayout is not present on the local system. In case the value is present, but you want to use the local keyboard layout of the user's client device instead, you can either delete the registry value or change it from 1 to 0.

Citrix Workspace app is configured to use either the local or remote keyboard layout (APPSRV.INI)

Citrix Workspace app includes several advanced preferences, one of which is the Keyboard and Language bar.

Solving keyboard layout issues - APPSRVINI LocalIMI

By default, the configuration of this setting is set to Use the server keyboard layout. As explained in the previous section, the server keyboard layout is actually the user's keyboard layout as configured in the (roaming) profile used in the ICA session.

Switching to Yes enables the keyboard layout synchronization feature which was introduced in XenDesktop 7.12 and Receiver 4.6. This feature not only synchronizes the keyboard layout of the local client to the ICA session at session launch, but it also dynamically changes the layout in the active ICA session when the keyboard layout on the local client is changed.

This setting is actually stored in the APPSRV.INI or at least it will be when you change it. The APPSRV.INI has been around for a very long time, since the early releases of Citrix Receiver. The file APPSRV.INI is a user-specific configuration file and is located in the following directory:

%AppData%\ICAClient APPSRV.INI
(= C:\Users\%UserName%\AppData\Roaming\ICAClient APPSRV.INI)

Selecting Yes in the above screenshot adds a new entry in the APPSRV.INI file: LocalIME=1

Set this value to 0 if you want to disable the keyboard synchronization feature and use the server-side keyboard layout.

Important note concerning Windows Server 2016!
As per Citrix: "This feature [local IME] is disabled in Windows Server 2016 due to a third-party issue which may introduce performance risk. [...]"
Configuring local IME using wfica32.exe and prevent users from changing settings
For the sake of completeness; it is also possible to change this setting using the command line: wfica32:exe /localime:on or wfica32:exe /localime:off.

You can prevent users from changing the keyboard settings in Citrix Workspace app by configuring the Group Policy Hide Local Keyboard Layout Settings.Hide keyboard setting in Citrix WorkspaceFor more information on Citrix Workspace app and Group Policies see the article Citrix Workspace app unattended installation with PowerShell on this website.

There is actually a second value that can be configured in the APPSRV.INI to set the keyboard layout (which has been around for a long long time): KeyboardLayout

By default, the value KeyboardLayout is missing from the APPSRV.INI file. When adding the value, choose either KeyboardLayout=(Server Default) or KeyboardLayout=(User Profile). The last one uses the keyboard layout of the user's local client.

The settings described in this section only apply to ICA sessions and not to RDP. In comparison, the  registry value IgnoreRemoteKeyboardLayout applies to both RDP and ICA sessions.

For more information see the following Citrix articles:

Local IME (and the keyboard synchronization feature) has been enabled or disabled on the Citrix worker (VDA)

In the previous section I described the keyboard synchronization feature (local IME). It is important to realize that this feature can also be managed from the Citrix worker (VDA). It is possible to enable or disable the feature by setting the following registry value:

  • Key: HKLM\SOFTWARE\Citrix\Ica\IcaIme
  • Name: DisableKeyboardSync
  • Value:
    • 0 (keyboard sync is enabled)
    • 1 (keyboard sync is disabled)
  • Type: DWORD

You can use a Group Policy Preference item to set the registry value.

Disable keyboard layout synchronization using Group Policy Preferences

In case you are sure that you have configured the settings in Citrix Workspace app correctly (and you have taken operating system specific issues into account) and the keyboard layout is still incorrect, you may have to enable or disable this setting.

The settings described in this section only apply to ICA sessions and not to RDP.

Common causes and solutions for issue 2 and 3 "the keyboard layout changes unexpectedly when opening another application in the same session or randomly during the session"

The cause for issues 2 and 3 lies in the Citrix keyboard layout synchronization feature in the Citrix Workspace app. As explained in one of the previous sectionsthis feature dynamically changes the keyboard layout in the active Citrix session when the local keyboard layout is changed.

For some reason though, the keyboard layout in the active session is changed on occasion although the local keyboard layout was not altered. The exact reason why this happens is unknown (the Citrix support engineer, although providing the solution, was not able to explain the exact cause either).

The solution to this problem is to disable the keyboard synchronization feature on the worker (VDA). This is done by modifying a registry value as described in the section Local IME.

Configuring this registry value (1 = disable) actually solved this issue for me!

What is strange about the whole situation is that:

  1. Technically speaking, keyboard layout synchronization should already be disabled based on the default setting "No, use the server keyboard layout" in Citrix Workspace app.
  2. Secondly, according to the Citrix documentation, on Windows Server 2016, this feature should already be deactivated: "This feature is disabled in Windows Server 2016 due to a third-party issue which might introduce performance risk. [...]"

This issue is also described in the Citrix article Receiver | keyboard language set on VDA is over ridden by the one set on the endpoint.

Citrix CTA Julian Mooren also describes this problem on his blog in the article XenApp – Keyboard Layout is switching occasionally in MUI environment.

The settings described in this section only apply to ICA sessions and not to RDP.

I hope the information presented in this article was of some help to you.

Share this post:
Dennis Span on EmailDennis Span on LinkedinDennis Span on Twitter
Dennis Span
Dennis Span
Dennis Span works as a Senior Citrix Architect for a large insurance company in Vienna, Austria. He holds multiple certifications such as CCE-V, CCIA and CCEA. In 2017, Dennis became a Citrix Technology Advocate (CTA). In 2019, he became a Citrix Technology Professional (CTP). Besides his interest in virtualization technologies and blogging, he loves spending time with his family as well as snowboarding, playing basketball and rowing. He is fluent in Dutch, English, German and Slovak and speaks some Spanish.

Leave a Reply

Your email address will not be published.

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.