From cb8c27ef71201615056ecd84d4ef2841e63a31d2 Mon Sep 17 00:00:00 2001 From: Kurtis Eveleigh Date: Mon, 30 Jul 2018 12:59:42 -0700 Subject: [PATCH 1/2] Fixes the case where XAML tries to cast to a uint Fixes #2384 --- Assets/HoloToolkit/UX/Scripts/Keyboard.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/HoloToolkit/UX/Scripts/Keyboard.cs b/Assets/HoloToolkit/UX/Scripts/Keyboard.cs index 63f6a5924b1..1a7e6f87ae9 100644 --- a/Assets/HoloToolkit/UX/Scripts/Keyboard.cs +++ b/Assets/HoloToolkit/UX/Scripts/Keyboard.cs @@ -253,7 +253,7 @@ protected override void Awake() // Setting the keyboardType to an undefined TouchScreenKeyboardType, // which prevents the MRTK keyboard from triggering the system keyboard itself. - InputField.keyboardType = (TouchScreenKeyboardType)(-1); + InputField.keyboardType = (TouchScreenKeyboardType)(int.MaxValue); // Keep keyboard deactivated until needed gameObject.SetActive(false); From 1a17899ddfb84152bca935f665d259e03e5e9bab Mon Sep 17 00:00:00 2001 From: Kurtis Eveleigh Date: Mon, 30 Jul 2018 13:32:31 -0700 Subject: [PATCH 2/2] Only open the MRTK keyboard if not platform keyboard is supported. --- .../UX/Scripts/KeyboardInputField.cs | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/Assets/HoloToolkit/UX/Scripts/KeyboardInputField.cs b/Assets/HoloToolkit/UX/Scripts/KeyboardInputField.cs index 9153bdf67f7..b2d8cf186b5 100644 --- a/Assets/HoloToolkit/UX/Scripts/KeyboardInputField.cs +++ b/Assets/HoloToolkit/UX/Scripts/KeyboardInputField.cs @@ -34,21 +34,24 @@ public override void OnPointerClick(PointerEventData eventData) { base.OnPointerClick(eventData); - Keyboard.Instance.Close(); - Keyboard.Instance.PresentKeyboard(text, KeyboardLayout); - - if (KeyboardSpawnPoint != null) - { - Keyboard.Instance.RepositionKeyboard(KeyboardSpawnPoint, null, KeyBoardPositionOffset); - } - else + if (!TouchScreenKeyboard.isSupported) { - Keyboard.Instance.RepositionKeyboard(transform, null, KeyBoardPositionOffset); - } + Keyboard.Instance.Close(); + Keyboard.Instance.PresentKeyboard(text, KeyboardLayout); + + if (KeyboardSpawnPoint != null) + { + Keyboard.Instance.RepositionKeyboard(KeyboardSpawnPoint, null, KeyBoardPositionOffset); + } + else + { + Keyboard.Instance.RepositionKeyboard(transform, null, KeyBoardPositionOffset); + } - // Subscribe to keyboard delegates - Keyboard.Instance.OnTextUpdated += Keyboard_OnTextUpdated; - Keyboard.Instance.OnClosed += Keyboard_OnClosed; + // Subscribe to keyboard delegates + Keyboard.Instance.OnTextUpdated += Keyboard_OnTextUpdated; + Keyboard.Instance.OnClosed += Keyboard_OnClosed; + } } ///