void keyboardKeyPressed(OnScreenKeyboard sender, OnScreenKeyboardArguments args)
 {
     if (sticky != null)
     {
         string text = sticky.gameObject.name;
         switch (args.KeyPressed.type)
         {
             case KeyClass.Backspace:
                 if (text.Length > 0)
                     text = text.Substring(0, text.Length - 1);
                 break;
             case KeyClass.Return:
                 text += args.KeyPressed.ToString();
                 break;
             case KeyClass.Shift:
                 //No need to do anything here as the keyboard will sort that on its own
                 break;
             case KeyClass.String:
                 text += args.KeyPressed.ToString();
                 break;
         }
         sticky.gameObject.name = text;
         sticky.textPointer = text.Length;
         sticky.StickyText = text;
     }
 }
Пример #2
0
        protected void KeyboardKeyPressed(OnScreenKeyboard sender, OnScreenKeyboardArguments args)
        {
            if (ActiveField)
            {
                InputField outputText = ActiveField.input;
                switch (args.KeyPressed.type)
                {
                case KeyClass.Backspace:
                    if (outputText.text.Length > 0)
                    {
                        outputText.text = outputText.text.Substring(0, outputText.text.Length - 1);
                    }
                    break;

                case KeyClass.Return:
                    outputText.text += args.KeyPressed.ToString();
                    break;

                case KeyClass.Shift:
                    //No need to do anything here as the keyboard will sort that on its own
                    break;

                case KeyClass.String:
                    if (outputText.characterLimit > 0 && outputText.text.Length >= outputText.characterLimit)
                    {
                        break;
                    }
                    outputText.text += args.KeyPressed.ToString();
                    break;
                }
                ActiveField.AddValues();
            }
        }
Пример #3
0
    // Token: 0x06003AD2 RID: 15058 RVA: 0x00128F20 File Offset: 0x00127320
    private void keyboardKeyPressed(OnScreenKeyboard sender, OnScreenKeyboardArguments args)
    {
        switch (args.KeyPressed.type)
        {
        case KeyClass.String:
        {
            Text text = this.outputText;
            text.text += args.KeyPressed.ToString();
            break;
        }

        case KeyClass.Return:
        {
            Text text2 = this.outputText;
            text2.text += args.KeyPressed.ToString();
            break;
        }

        case KeyClass.Backspace:
            if (this.outputText.text.Length > 0)
            {
                this.outputText.text = this.outputText.text.Substring(0, this.outputText.text.Length - 1);
            }
            break;
        }
    }
Пример #4
0
    // Token: 0x06006382 RID: 25474 RVA: 0x002358FC File Offset: 0x00233CFC
    private void KeyboardKeyPressed(OnScreenKeyboard sender, OnScreenKeyboardArguments args)
    {
        switch (args.KeyPressed.type)
        {
        case KeyClass.String:
            if (this.mWasJustFocused)
            {
                this.UnfocusInput();
                this.popupInputField.text = args.KeyPressed.ToString();
                this.inputtedKeyCodes.Add(args.KeyPressed.keyCode);
            }
            else
            {
                InputField inputField = this.popupInputField;
                inputField.text += args.KeyPressed.ToString();
                this.inputtedKeyCodes.Add(args.KeyPressed.keyCode);
            }
            this.popupInputField.MoveTextEnd(false);
            break;

        case KeyClass.Shift:
            this.UnfocusInput();
            break;

        case KeyClass.Return:
        {
            InputField inputField2 = this.popupInputField;
            inputField2.text += args.KeyPressed.ToString();
            this.inputtedKeyCodes.Add(args.KeyPressed.keyCode);
            break;
        }

        case KeyClass.Backspace:
            if (this.mWasJustFocused)
            {
                this.UnfocusInput();
                this.popupInputField.text = string.Empty;
                this.inputtedKeyCodes.Clear();
            }
            else if (this.popupInputField.text.Length > 0)
            {
                this.popupInputField.text = this.popupInputField.text.Substring(0, this.popupInputField.text.Length - 1);
                this.inputtedKeyCodes.RemoveAt(this.inputtedKeyCodes.Count - 1);
            }
            break;
        }
        if (this.popupInputField.isFocused && !Input.GetMouseButtonDown(0) && !Input.GetMouseButtonDown(1) && Input.anyKeyDown)
        {
            this.UnfocusInput();
        }
    }
Пример #5
0
 void keyboardKeyPressed(OnScreenKeyboard sender, OnScreenKeyboardArguments args)
 {
     switch (args.KeyPressed.type)
     {
     case KeyClass.Backspace:
         if(outputText.text.Length > 0)
             outputText.text = outputText.text.Substring(0, outputText.text.Length -1);
         break;
     case KeyClass.Return:
         outputText.text += args.KeyPressed.ToString();
         break;
     case KeyClass.Shift:
         //No need to do anything here as the keyboard will sort that on its own
         break;
     case KeyClass.String:
         outputText.text += args.KeyPressed.ToString();
         break;
     }
 }
    void OnKeyboardKeyPressed(OnScreenKeyboard sender, OnScreenKeyboardArguments args)
    {
        // print ("OnKeyboardKeyPressed.type: " + args.KeyPressed.type);

        if (_disableKeyboard)
        {
            return;
        }

        if (GameControl.instance.isMobile && _searchInputButtonText.text == _inputMessage)
        {
            _searchInputButtonText.text = "";
        }

        switch (args.KeyPressed.type)
        {
        case KeyClass.Backspace:
            if (_searchInputButtonText.text.Length > 0)
            {
                _disableKeyboard = true;

                _searchInputButtonText.text = _searchInputButtonText.text.Substring(0, _searchInputButtonText.text.Length - 1);

                Search(_searchInputButtonText.text);
            }
            break;

        case KeyClass.Return:
            OnSearchButtonClick();
            break;

        case KeyClass.Shift:
            break;

        case KeyClass.String:
            _searchInputButtonText.text += args.KeyPressed.ToString();

            Search(_searchInputButtonText.text);
            break;
        }
    }
    void keyboardKeyPressed(OnScreenKeyboard sender, OnScreenKeyboardArguments args)
    {
        switch (args.KeyPressed.type)
        {
        case KeyClass.Backspace:
            if (outputText.text.Length > 0)
            {
                outputText.text = outputText.text.Substring(0, outputText.text.Length - 1);
            }
            break;

        case KeyClass.Return:
            outputText.text += args.KeyPressed.ToString();
            break;

        case KeyClass.Shift:
            //No need to do anything here as the keyboard will sort that on its own
            break;

        case KeyClass.String:
            outputText.text += args.KeyPressed.ToString();
            break;
        }
    }
Пример #8
0
    protected void KeyboardKeyPressed(OnScreenKeyboard sender, OnScreenKeyboardArguments args)
    {
        if (ActiveField)
        {
            int caretPos;

            InputField outputText = ActiveField.input;
            switch (args.KeyPressed.type)
            {
            case KeyClass.Backspace:
                if (outputText.text.Length > 0 || outputText.caretPosition > 0)
                {
                    caretPos = outputText.caretPosition;

                    outputText.text = outputText.text.Remove(outputText.caretPosition - 1, 1);

                    outputText.caretPosition = caretPos - 1;
                }
                break;

            case KeyClass.Return:
                outputText.text += args.KeyPressed.ToString();
                break;

            case KeyClass.Shift:
                //No need to do anything here as the keyboard will sort that on its own
                break;

            case KeyClass.String:
                if (outputText.characterLimit > 0 && outputText.text.Length >= outputText.characterLimit)
                {
                    break;
                }

                caretPos = outputText.caretPosition;
                string s = outputText.text;
                outputText.text          = outputText.text.Insert(outputText.caretPosition, args.KeyPressed.ToString());
                outputText.caretPosition = caretPos + 1;
                break;

            case KeyClass.ModifySix:
                if (outputText.characterLimit > 0 && outputText.text.Length >= outputText.characterLimit)
                {
                    break;
                }

                caretPos = outputText.caretPosition;
                string x = outputText.text;
                outputText.text          = outputText.text.Insert(outputText.caretPosition, args.KeyPressed.ToString());
                outputText.caretPosition = caretPos + 6;
                break;

            case KeyClass.ModifyEight:
                if (outputText.characterLimit > 0 && outputText.text.Length >= outputText.characterLimit)
                {
                    break;
                }

                caretPos = outputText.caretPosition;
                string z = outputText.text;
                outputText.text          = outputText.text.Insert(outputText.caretPosition, args.KeyPressed.ToString());
                outputText.caretPosition = caretPos + 8;
                break;

            case KeyClass.ModifyFor:
                if (outputText.characterLimit > 0 && outputText.text.Length >= outputText.characterLimit)
                {
                    break;
                }

                caretPos = outputText.caretPosition;
                string w = outputText.text;
                outputText.text          = outputText.text.Insert(outputText.caretPosition, args.KeyPressed.ToString());
                outputText.caretPosition = caretPos + 4;
                break;

            case KeyClass.ModifyTree:
                if (outputText.characterLimit > 0 && outputText.text.Length >= outputText.characterLimit)
                {
                    break;
                }

                caretPos = outputText.caretPosition;
                string o = outputText.text;
                outputText.text          = outputText.text.Insert(outputText.caretPosition, args.KeyPressed.ToString());
                outputText.caretPosition = caretPos + 3;
                break;
            }

            ActiveField.AddValues();
        }
    }