Exemple #1
0
        static TouchScreenKeyboardType getKeyboardTypeForConfiguration(TextInputConfiguration config)
        {
            var inputType = config.inputType;

            if (inputType.index == TextInputType.url.index)
            {
                return(TouchScreenKeyboardType.URL);
            }

            if (inputType.index == TextInputType.emailAddress.index)
            {
                return(TouchScreenKeyboardType.EmailAddress);
            }

            if (inputType.index == TextInputType.phone.index)
            {
                return(TouchScreenKeyboardType.PhonePad);
            }

            if (inputType.index == TextInputType.number.index)
            {
                return(TouchScreenKeyboardType.NumberPad);
            }

            return(TouchScreenKeyboardType.Default);
        }
Exemple #2
0
        public static TextInputConnection attach(TextInputClient client, TextInputConfiguration configuration)
        {
            D.assert(client != null);
            var connection = new TextInputConnection(client);

            _currentConnection = connection;
            if (keyboardDelegate != null)
            {
                keyboardDelegate.Dispose();
            }

            if (Application.isEditor)
            {
                keyboardDelegate = new DefaultKeyboardDelegate();
            }
            else
            {
#if UNITY_IOS || UNITY_ANDROID
                if (configuration.unityTouchKeyboard)
                {
                    keyboardDelegate = new UnityTouchScreenKeyboardDelegate();
                }
                else
                {
                    keyboardDelegate = new UIWidgetsTouchScreenKeyboardDelegate();
                }
#elif UNITY_WEBGL
                keyboardDelegate = new UIWidgetsWebGLKeyboardDelegate();
#else
                keyboardDelegate = new DefaultKeyboardDelegate();
#endif
            }
            keyboardDelegate.setClient(connection._id, configuration);
            return(connection);
        }
Exemple #3
0
        public TextInputConnection attach(TextInputClient client, TextInputConfiguration configuration)
        {
            D.assert(client != null);
            var connection = new TextInputConnection(client, this);

            this.keyboardManager.setClient(connection._id, configuration);
            this._currentConnection = connection;
            return(connection);
        }
Exemple #4
0
 public void setClient(int client, TextInputConfiguration configuration)
 {
     this._client = client;
 }
Exemple #5
0
 public override void setClient(int client, TextInputConfiguration configuration)
 {
     UIWidgetsTextInputSetClient(client, configuration.toJson().ToString());
 }
Exemple #6
0
 public override void setClient(int client, TextInputConfiguration configuration)
 {
     WebGLInput.captureAllKeyboardInput = false;
     Input.imeCompositionMode           = IMECompositionMode.On;
     UIWidgetsTextInputSetClient(client, configuration.toJson().ToString());
 }
Exemple #7
0
 public abstract void setClient(int client, TextInputConfiguration configuration);
Exemple #8
0
 public void setClient(int client, TextInputConfiguration configuration)
 {
     _client        = client;
     _configuration = configuration;
 }
Exemple #9
0
 public void clearClient()
 {
     _client = 0;
     _textInputConfiguration = null;
 }