Skip to content

Commit 1a17899

Browse files
committed
Only open the MRTK keyboard if not platform keyboard is supported.
1 parent cb8c27e commit 1a17899

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

Assets/HoloToolkit/UX/Scripts/KeyboardInputField.cs

+16-13
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,24 @@ public override void OnPointerClick(PointerEventData eventData)
3434
{
3535
base.OnPointerClick(eventData);
3636

37-
Keyboard.Instance.Close();
38-
Keyboard.Instance.PresentKeyboard(text, KeyboardLayout);
39-
40-
if (KeyboardSpawnPoint != null)
41-
{
42-
Keyboard.Instance.RepositionKeyboard(KeyboardSpawnPoint, null, KeyBoardPositionOffset);
43-
}
44-
else
37+
if (!TouchScreenKeyboard.isSupported)
4538
{
46-
Keyboard.Instance.RepositionKeyboard(transform, null, KeyBoardPositionOffset);
47-
}
39+
Keyboard.Instance.Close();
40+
Keyboard.Instance.PresentKeyboard(text, KeyboardLayout);
41+
42+
if (KeyboardSpawnPoint != null)
43+
{
44+
Keyboard.Instance.RepositionKeyboard(KeyboardSpawnPoint, null, KeyBoardPositionOffset);
45+
}
46+
else
47+
{
48+
Keyboard.Instance.RepositionKeyboard(transform, null, KeyBoardPositionOffset);
49+
}
4850

49-
// Subscribe to keyboard delegates
50-
Keyboard.Instance.OnTextUpdated += Keyboard_OnTextUpdated;
51-
Keyboard.Instance.OnClosed += Keyboard_OnClosed;
51+
// Subscribe to keyboard delegates
52+
Keyboard.Instance.OnTextUpdated += Keyboard_OnTextUpdated;
53+
Keyboard.Instance.OnClosed += Keyboard_OnClosed;
54+
}
5255
}
5356

5457
/// <summary>

0 commit comments

Comments
 (0)