This project is read-only.

window.Keyboard.Enter is not setting correctly the text (locales problem)

Dec 3, 2010 at 10:47 AM


We are using the following line of code to set a text to the focused element:

window.Keyboard.Enter(String.Format(@"c:\{0}.motor", _customMotorname));

When stopping in the code with debugger, the string is: "c:\\Test1.motor"

On the screen, the string set is: "c:<Test1.motor"

This behavior appears with a Swiss-French keyboard set. On the same key, we have "<", ">" (Shift), "\" (Ctrl+Alt).
It seems that using Keyboard.Enter is not managing correctly the Ctrl+Alt stuff, entering the correct char for the key, but taking in account moodifiers key.

Are we missing something? (locales configuration)
Other ways to enter the text?



Jan 12, 2011 at 12:33 PM
Edited Jan 12, 2011 at 1:12 PM

I had the same problem with a German keyboard layout. I wrote a method that helped to work around the problem. This method is located in a class deriving from Repository.AppScreen.



/// <summary>
/// Enters a path using the window's keyboard. This is necessary because
/// special keys like "\\" do not get entered correctly by the default
/// behavior of the keyboard, when other layouts than English are used.
/// </summary>
/// <param name="path">The path to be entered.</param>
private void enterPath(String path)
	AttachedKeyboard keyboard = window.Keyboard;
	char[] separators = new char[] { '\\' };
	String[] sections = path.Split(separators);

	int sectionIdx = 0;
	int lastSection = sections.Length - 1;
	foreach (String section in sections)

		if (sectionIdx < lastSection)
			// type backslash with Ctrl and Alt pressed, due to German
			// keyboard layout




I had a look at the white repository and it seems that the problem is to be found in "Core/InputDevices/Keyboard.cs" in method Send(...). The text to be typed is only checked for if Shift needs to be pressed to get a specific character. This seems to work fine for the English keyboard layouts, but others might need the functionality to check for Ctrl and Alt as well...

Jan 13, 2011 at 3:59 PM

I just uploaded a patch for the White project that fixes exactly this issue. Hopefully it will be applied... ;)




Apr 18, 2011 at 4:47 PM

Hi n00bie!

I am having the same problem ... I tried to compile white from source but your patch does not seem to be included yet :( Can you, by any chance post the code of the fix here? That would be very helpful!



Apr 18, 2011 at 5:16 PM

Hi Ingo!

You can download the patch from this site at

or directly via

and apply it yourself.


If you are using the Tortoise SVN client in Windows, you just need to go to your check-out folder of WHITE using Windows Explorer and use the right-click context menu "TortoiseSVN -> Apply patch..." to do that. Simply select the downloaded patch-file, and you are done.


You can open the patch-file with any text-editor, so you can explore the changes yourself if you like.


Hope that helps!




Apr 19, 2011 at 8:16 AM

Hi n00bie!

Your patch is working like a charm!

Thank you verry much