Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
// Copyright (c) Mixed Reality Toolkit Contributors
// Licensed under the BSD 3-Clause

// Disable "missing XML comment" warning for samples. While nice to have, this XML documentation is not required for samples.
#pragma warning disable CS1591

using MixedReality.Toolkit.Input;
using MixedReality.Toolkit.UX;
using TMPro;
using UnityEngine;
Expand All @@ -30,10 +26,8 @@ public class SystemKeyboardExample : MonoBehaviour
[SerializeField]
private TextMeshPro debugMessage = null;

#pragma warning disable 0414
[SerializeField]
private KeyboardPreview mixedRealityKeyboardPreview = null;
#pragma warning restore 0414

/// <summary>
/// Opens a platform specific keyboard.
Expand All @@ -43,15 +37,18 @@ public void OpenSystemKeyboard()
#if WINDOWS_UWP
wmrKeyboard.ShowKeyboard(wmrKeyboard.Text, false);
#elif UNITY_IOS || UNITY_ANDROID
touchscreenKeyboard = TouchScreenKeyboard.Open(string.Empty, TouchScreenKeyboardType.Default, false, false, false, false);
if (TouchScreenKeyboard.isSupported)
{
touchscreenKeyboard = TouchScreenKeyboard.Open(string.Empty, TouchScreenKeyboardType.Default, false, false, false, false);
}
#endif
}

#region MonoBehaviour Implementation

/// <summary>
/// A Unity event function that is called on the frame when a script is enabled just before any of the update methods are called the first time.
/// </summary>
/// </summary>
private void Start()
{
// Initially hide the preview.
Expand Down Expand Up @@ -91,7 +88,6 @@ private void Start()
#endif
}


#if WINDOWS_UWP
/// <summary>
/// A Unity event function that is called every frame, if this object is enabled.
Expand Down Expand Up @@ -149,19 +145,19 @@ private void Update()
// touch screen keyboard.
if (touchscreenKeyboard != null)
{
string KeyboardText = touchscreenKeyboard.text;
string keyboardText = touchscreenKeyboard.text;
if (TouchScreenKeyboard.visible)
{
if (debugMessage != null)
{
debugMessage.text = "typing... " + KeyboardText;
debugMessage.text = "typing... " + keyboardText;
}
}
else
{
if (debugMessage != null)
{
debugMessage.text = "typed " + KeyboardText;
debugMessage.text = "typed " + keyboardText;
}

touchscreenKeyboard = null;
Expand All @@ -173,4 +169,3 @@ private void Update()
#endregion MonoBehaviour Implementation
}
}
#pragma warning restore CS1591