public void UpdateStructure() { Keys = new List <OnScreenKeyboardKey>(gameObject.GetComponentsInChildren <OnScreenKeyboardKey>()); //Load the key list if (Keys.Count < 1) { Debug.LogWarning("Heathen On Screen Keyboard was unable to locate an OnScreeKeboardKey component in any of its children.\nPlease add at least 1 key or indicate a key on the OnScreenKeyboard behaviour by setting the ActiveKey value.", this); } if (Keys.Count > 0 && (ActiveKey == null || !Keys.Contains(ActiveKey))) { //The developer didn't tell us where to start or gave us an orphan so pick the first child we found under us ActiveKey = Keys[0]; } foreach (OnScreenKeyboardKey key in Keys) { key.Keyboard = this; } }
/// <summary> /// Initializes a new instance of the <see cref="OnScreenKeyboardArguments"/> class. /// </summary> /// <param name="KeyPressed">Key pressed.</param> public OnScreenKeyboardArguments(OnScreenKeyboardKey KeyPressed) { this.KeyPressed = KeyPressed; }
/// <summary> /// Navigates down from the current key. /// </summary> /// <returns>The key below the current.</returns> public OnScreenKeyboardKey NavigateDown() { ActiveKey = ActiveKey.DownKey; return(ActiveKey); }
/// <summary> /// Navigates down from the current key. /// </summary> /// <returns>The key below the current.</returns> public OnScreenKeyboardKey NavigateRight() { ActiveKey = ActiveKey.RightKey; return(ActiveKey); }
/// <summary> /// Navigates down from the current key. /// </summary> /// <returns>The key below the current.</returns> public OnScreenKeyboardKey NavigateLeft() { ActiveKey = ActiveKey.LeftKey; return(ActiveKey); }
/// <summary> /// Navigates down from the current key. /// </summary> /// <returns>The key below the current.</returns> public OnScreenKeyboardKey NavigateUp() { ActiveKey = ActiveKey.UpKey; return(ActiveKey); }