- Moderator
- #1
I'm using the code below to display a virtual keyboard for the user. The method parameter "strLine" is supposed to be the text that is visible in the keyboard when it is first shown to user.
However it seems that if this string parameter is long enough the text will not show at all when the keyboard is displayed (screenshot 1). If I use backspace on the keyboard to delete characters, at some point the cursor will show up but there is no text (screenshot 2). Eventually deleting more characters show the beginning of the text (screenshot 3).
The full string in this particular case is "Stratovarius – Under Flaming Winter Skies - Live in Tampere (The Jörg Michael Farewell Tour)"
However it seems that if this string parameter is long enough the text will not show at all when the keyboard is displayed (screenshot 1). If I use backspace on the keyboard to delete characters, at some point the cursor will show up but there is no text (screenshot 2). Eventually deleting more characters show the beginning of the text (screenshot 3).
The full string in this particular case is "Stratovarius – Under Flaming Winter Skies - Live in Tampere (The Jörg Michael Farewell Tour)"
Code:
/// <summary>
/// Gets the input from the virtual keyboard window.
/// </summary>
public static bool GetStringFromKeyboard(ref string strLine)
{
if (strLine == null)
strLine = "";
VirtualKeyboard keyboard = (VirtualKeyboard)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_VIRTUAL_KEYBOARD);
keyboard.Reset();
keyboard.Text = strLine;
keyboard.DoModal(GUIWindowManager.ActiveWindow);
if (keyboard.IsConfirmed)
{
strLine = keyboard.Text;
if (!String.IsNullOrEmpty(strLine))
return true;
}
return false;
}