コード例 #1
0
        private static void KeyboardTapKey(object sender, TapKeyEventArgs args)
        {
            switch (args.Value.ToLower())
            {
            case Keyboard.ActionKey.Backspace:
                if (_keyboardText.Text.Length > 0)
                {
                    _keyboardText.Text = _keyboardText.Text.Substring(0, _keyboardText.Text.Length - 1);
                    _keyboardText.Invalidate();
                }
                if (_keyboardText.Text.Length == 0 && !_keyboard.Uppercase)
                {
                    _keyboard.Uppercase   = true;
                    _keyboard.CurrentView = Keyboard.View.Letters;
                    _keyboard.CalculateKeys();
                    _keyboard.Invalidate();
                    _keyboard.DrawKeyDown(args.Index);
                }
                break;

            case Keyboard.ActionKey.Return:
                CloseKeyboard();
                break;

            case Keyboard.ActionKey.Space:
                _keyboardText.Text += " ";
                _keyboardText.Invalidate();
                break;

            case Keyboard.ActionKey.Tab:
                _keyboardText.Text += "   ";
                _keyboardText.Invalidate();
                break;

            default:
                _keyboardText.Text += args.Value;
                _keyboardText.Invalidate();

                /*
                 * if (_keyboardText.Text.Length == 1)
                 * {
                 *  if (_keyboard.CurrentView == Keyboard.View.Letters)
                 *  {
                 *      _keyboard.Uppercase = false;
                 *      _keyboard.CurrentView = Keyboard.View.Letters;
                 *  }
                 * }
                 */
                break;
            }
        }
コード例 #2
0
ファイル: Glide.cs プロジェクト: jakesays/Glide
        private static void KeyboardTapKey(object sender, TapKeyEventArgs args)
        {
            switch (args.Value.ToLower())
            {
                case Keyboard.ActionKey.Backspace:
                    if (_keyboardText.Text.Length > 0)
                    {
                        _keyboardText.Text = _keyboardText.Text.Substring(0, _keyboardText.Text.Length - 1);
                        _keyboardText.Invalidate();
                    }
                    if (_keyboardText.Text.Length == 0 && !_keyboard.Uppercase)
                    {
                        _keyboard.Uppercase = true;
                        _keyboard.CurrentView = Keyboard.View.Letters;
                        _keyboard.CalculateKeys();
                        _keyboard.Invalidate();
                        _keyboard.DrawKeyDown(args.Index);
                    }
                    break;

                case Keyboard.ActionKey.Return:
                    CloseKeyboard();
                    break;

                case Keyboard.ActionKey.Space:
                    _keyboardText.Text += " ";
                    _keyboardText.Invalidate();
                    break;

                case Keyboard.ActionKey.Tab:
                    _keyboardText.Text += "   ";
                    _keyboardText.Invalidate();
                    break;

                default:
                    _keyboardText.Text += args.Value;
                    _keyboardText.Invalidate();
                    /*
                    if (_keyboardText.Text.Length == 1)
                    {
                        if (_keyboard.CurrentView == Keyboard.View.Letters)
                        {
                            _keyboard.Uppercase = false;
                            _keyboard.CurrentView = Keyboard.View.Letters;
                        }
                    }
                    */
                    break;
            }
        }