コード例 #1
0
    private bool ProcessTextInputFinishKeys()
    {
        if (!this.m_inputFocused)
        {
            return(false);
        }
        if (Event.current.type != EventType.KeyDown)
        {
            return(false);
        }
        KeyCode keyCode = Event.current.keyCode;

        if (keyCode != KeyCode.Return)
        {
            if (keyCode != KeyCode.Escape)
            {
                return(false);
            }
        }
        else
        {
            this.m_inputIgnoreState = TextInputIgnoreState.COMPLETE_KEY_UP;
            this.CompleteTextInput();
            return(true);
        }
        this.m_inputIgnoreState = TextInputIgnoreState.CANCEL_KEY_UP;
        this.UserCancelTextInput();
        return(true);
    }
コード例 #2
0
    private bool IgnoreGUIInput()
    {
        if (this.m_inputIgnoreState == TextInputIgnoreState.INVALID)
        {
            return(false);
        }
        if (Event.current.type != EventType.KeyUp)
        {
            return(false);
        }
        KeyCode keyCode = Event.current.keyCode;

        if (keyCode != KeyCode.Return)
        {
            if (keyCode != KeyCode.Escape)
            {
                return(false);
            }
        }
        else
        {
            if (this.m_inputIgnoreState == TextInputIgnoreState.COMPLETE_KEY_UP)
            {
                this.m_inputIgnoreState = TextInputIgnoreState.NEXT_CALL;
            }
            return(true);
        }
        if (this.m_inputIgnoreState == TextInputIgnoreState.CANCEL_KEY_UP)
        {
            this.m_inputIgnoreState = TextInputIgnoreState.NEXT_CALL;
        }
        return(true);
    }
コード例 #3
0
 public void UseTextInput(TextInputParams parms, bool force = false)
 {
     if (force || (parms.m_owner != this.m_inputOwner))
     {
         if ((this.m_inputOwner != null) && (this.m_inputOwner != parms.m_owner))
         {
             this.ObjectCancelTextInput(parms.m_owner);
         }
         this.m_inputOwner              = parms.m_owner;
         this.m_inputUpdatedCallback    = parms.m_updatedCallback;
         this.m_inputPreprocessCallback = parms.m_preprocessCallback;
         this.m_inputCompletedCallback  = parms.m_completedCallback;
         this.m_inputCanceledCallback   = parms.m_canceledCallback;
         this.m_inputPassword           = parms.m_password;
         this.m_inputNumber             = parms.m_number;
         this.m_inputMultiLine          = parms.m_multiLine;
         this.m_inputActive             = true;
         this.m_inputFocused            = false;
         if (parms.m_text == null)
         {
         }
         this.m_inputText                = string.Empty;
         this.m_inputNormalizedRect      = parms.m_rect;
         this.m_inputInitialScreenSize.x = Screen.width;
         this.m_inputInitialScreenSize.y = Screen.height;
         this.m_inputMaxCharacters       = parms.m_maxCharacters;
         this.m_inputColor               = parms.m_color;
         TextAnchor?alignment = parms.m_alignment;
         this.m_inputAlignment = !alignment.HasValue ? this.m_defaultInputAlignment : alignment.Value;
         if (parms.m_font == null)
         {
         }
         this.m_inputFont                = this.m_defaultInputFont;
         this.m_inputNeedsFocus          = true;
         this.m_inputIgnoreState         = TextInputIgnoreState.INVALID;
         this.m_inputKeepFocusOnComplete = parms.m_inputKeepFocusOnComplete;
         if (this.IsTextInputPassword())
         {
             Input.imeCompositionMode = IMECompositionMode.Off;
         }
         this.m_hideVirtualKeyboardOnComplete = parms.m_hideVirtualKeyboardOnComplete;
         if (Get().IsTouchMode() && parms.m_showVirtualKeyboard)
         {
             W8Touch.Get().ShowKeyboard();
         }
     }
 }
コード例 #4
0
 private void HandleGUIInputInactive()
 {
     if (!this.m_inputActive)
     {
         if (this.m_inputIgnoreState != TextInputIgnoreState.INVALID)
         {
             if (this.m_inputIgnoreState == TextInputIgnoreState.NEXT_CALL)
             {
                 this.m_inputIgnoreState = TextInputIgnoreState.INVALID;
             }
         }
         else if (ChatMgr.Get() != null)
         {
             ChatMgr.Get().HandleGUIInput();
         }
     }
 }