Skip to content

Commit 90355dd

Browse files
author
David Kline
authored
Merge pull request #2522 from keveleigh/Keyboard
Minor keyboard fixes
2 parents 95547c1 + 1a17899 commit 90355dd

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

Assets/HoloToolkit/UX/Scripts/Keyboard.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ protected override void Awake()
253253

254254
// Setting the keyboardType to an undefined TouchScreenKeyboardType,
255255
// which prevents the MRTK keyboard from triggering the system keyboard itself.
256-
InputField.keyboardType = (TouchScreenKeyboardType)(-1);
256+
InputField.keyboardType = (TouchScreenKeyboardType)(int.MaxValue);
257257

258258
// Keep keyboard deactivated until needed
259259
gameObject.SetActive(false);

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)