/// <summary>
        /// Handles a selected key.
        /// </summary>
        /// <param name="tapped">The key that was tapped.</param>
        public void HandleTap(KeyboardItem tapped)
        {
            string value = tapped.Value;

            if (value.Equals(Keys.QEH) || value.Equals(Keys.ABC))
            {
                SwitchSpecialKeys();
            }
            else if (value.Equals(Keys.UP) || value.Equals(Keys.LOW))
            {
                SwitchUpperAndLowerKeys();
            }
            else if (value.Equals(Keys.SPACE))
            {
                Output.OnKey(Keys.SPACE);
            }
            else if (value.Equals(Keys.BACK))
            {
                Output.OnBack();
            }
            else
            {
                Output.OnKey(value);
            }
        }
 private Vector3 RestorePosition(KeyboardItem key)
 {
     return(new Vector3(
                key.transform.localPosition.x,
                key.transform.localPosition.y,
                key.transform.localPosition.z - distanceToCenter + RADIUS));
 }
        private void SetKeyPosition(KeyboardItem key)
        {
            int       iteration    = key.Index;
            Transform keyTransform = key.transform;
            // Check row and how many keys were placed
            float keysPlaced = CalculateKeyOffsetAndRow(iteration);
            float degree     = CalculateKeyRotation(Keys.LettersInRowsCount[row] - 1, iteration - keysPlaced);

            //caluclate position on cylinder with circle equation formula
            //http://www.mathopenref.com/coordparamcircle.html
            key.transform.localPosition = CalculatePositionOnCylinder(degree);
            //rotate keys by their placement angle
            key.transform.localEulerAngles = new Vector3(0, -degree * Mathf.Rad2Deg - 90f, 0);
            // keys are moved from center couse of increasing circle radius,
            // so position must be restored to radius
            key.transform.localPosition = RestorePosition(key);
        }
 private void SetKeySize(KeyboardItem key)
 {
     key.transform.localScale = new Vector3(KEY_SIZE, KEY_SIZE, 0.1f);
 }